Synchronization and exchange of data between processors

ABSTRACT

A system comprising: a first subsystem comprising one or more first processors, and a second subsystem comprising one or more second processors. The second subsystem is configured to process code over a series of steps delineated by barrier synchronizations, and in a current step, to send a descriptor to the first subsystem specifying a value of each of one or more parameters of each of one or more interactions that the second subsystem is programmed to perform with the first subsystem via an inter-processor interconnect in a subsequent step. The first subsystem is configured to execute a portion of code to perform one or more preparatory operations, based on the specified values of at least one of the one or more parameters of each interaction as specified by the descriptor, to prepare for said one or more interactions prior to the barrier synchronization leading into the subsequent phase.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of U.S. patent applicationSer. No. 16/276,834, filed Feb. 15, 2019, which claims priority toUnited Kingdom Application No. 1811017.1, filed Jul. 4, 2018, and UnitedKingdom Application No. 1821193.8, filed Dec. 24, 2018, all of which arehereby incorporated by reference herein in their entirety.

TECHNICAL FIELD

The present disclosure relates to the interaction between a firstsubsystem comprising at least one first processor, such as a hostprocessor, and a second subsystem comprising one or more secondprocessors such as accelerator processors to which the host assignswork. In embodiments the disclosure also relates to a synchronizationscheme such as BSP (bulk synchronous parallel) whereby execution isdivided into a plurality of steps with barrier synchronizationstherebetween.

BACKGROUND

A multi-threaded processor is a processor which is capable of executingmultiple program threads alongside one another. The processor maycomprise some hardware that is common to the multiple different threads(e.g. a common instruction memory, data memory and/or execution unit);but to support the multi-threading, the processor also comprises somededicated hardware specific to each thread.

The dedicated hardware comprises at least a respective context registerfile for each of the number of threads that can be executed at once. A“context”, when talking about multi-threaded processors, refers to theprogram state of a respective one of the threads being executedalongside one another (e.g. program counter value, status and currentoperand values). The context register file refers to the respectivecollection of registers for representing this program state of therespective thread. Registers in a register file are distinct fromgeneral purpose memory in that register addresses are fixed as bits ininstruction words, whereas memory addresses can be computed by executinginstructions. The registers of a given context typically comprise arespective program counter for the respective thread, and a respectiveset of operand registers for temporarily holding the data acted upon andoutput by the respective thread during the computations performed bythat thread. Each context may also have a respective status register forstoring a status of the respective thread (e.g. whether it is paused orrunning). Thus each of the currently running threads has its ownseparate program counter, and optionally operand registers and statusregister(s).

One possible form of multi-threading is parallelism. That is, as well asmultiple contexts, multiple execution pipelines are provided: i.e. aseparate execution pipeline for each stream of instructions to beexecuted in parallel. However, this requires a great deal of duplicationin terms of hardware.

Instead therefore, another form of multi-threaded processor employsconcurrency rather than parallelism, whereby the threads share a commonexecution pipeline (or at least a common part of a pipeline) anddifferent threads are interleaved through this same, shared executionpipeline. Performance of a multi-threaded processor may still beimproved compared to no concurrency or parallelism, thanks to increasedopportunities for hiding pipeline latency. Also, this approach does notrequire as much extra hardware dedicated to each thread as a fullyparallel processor with multiple execution pipelines, and so does notincur so much extra silicon.

One form of parallelism can be achieved by means of a processorcomprising an arrangement of multiple tiles on the same chip (i.e. samedie), each tile comprising its own separate respective processing unitand memory (including program memory and data memory). Thus separateportions of program code can be run in parallel on different ones of thetiles. The tiles are connected together via an on-chip interconnectwhich enables the code run on the different tiles to communicate betweentiles. In some cases the processing unit on each tile may itself runmultiple concurrent threads on tile, each tile having its own respectiveset of contexts and corresponding pipeline as described above in orderto support interleaving of multiple threads on the same tile through thesame pipeline.

In general, there may exist dependencies between the portions of aprogram running on different tiles. A technique is therefore required toprevent a piece of code on one tile running ahead of data upon which itis dependent being made available by another piece of code on anothertile. There are a number of possible schemes for achieving this, but thescheme of interest herein is known as “bulk synchronous parallel” (BSP).According to BSP, each tile performs a compute phase and an exchangephase in an alternating cycle. During the compute phase each tileperforms one or more computation tasks locally on tile, but does notcommunicate any results of its computations with any others of thetiles. In the exchange phase each tile is allowed to exchange one ormore results of the computations from the preceding compute phase toand/or from one or more others of the tiles in the group, but does notyet proceed to the next compute phase. Further, according to the BSPprinciple, a barrier synchronization is placed at the juncturetransitioning from the compute phase into the exchange phase, ortransitioning from the exchange phase into the compute phase, or both.That is it say, either: (a) all tiles are required to complete theirrespective compute phases before any in the group is allowed to proceedto the next exchange phase, or (b) all tiles in the group are requiredto complete their respective exchange phases before any tile in thegroup is allowed to proceed to the next compute phase, or (c) both. Insome scenarios a tile in the compute phase may be allowed to communicatewith other system resources such as a network card or storage disk, aslong as no communication with other tiles in the group is involved.

In an interconnected system of senders and receivers that may also havecompute tasks to perform in between communicating with one another,there are essentially three ways the senders and receivers can implementthis. The first is the “rendez vous” approach. According to thisapproach the sender signals to the receiver when it is ready to senddata and the receiver signals to the sender when it is ready to receivedata. If the sender has data ready to send but the receiver isperforming some other, compute task, then the sender must either waitfor the receiver to finish its computing task and signal its readinessto receive data from the sender, or else the sender must interrupt thereceiver. Similarly if the receiver requires data from the sender whilethe sender is still performing some other, compute task, then thereceiver must either wait for the sender to finish its compute task andsignal its readiness to send data to the receiver, or else the receivermust interrupt the sender. The rendez vous approach has the advantagethat it does not require queues to queue the transmitted data, sincecommunication of the data only proceeds once both sender and receiverhave agreed they are ready to communicate. However, the downside islatency: the senders and receivers will spend a lot of time waiting forone another, or else will have to perform a lot of interrupts which alsoincur a latency penalty. The latency ultimately manifests itself asreduced throughput.

The second possibility is the “post-box” approach. According to thisapproach the sender does not wait for the receiver before sending itsdata. Instead the transmitted data is buffered in a queue, from whichthe receiver reads the data when it is ready. As long as the queues arelong enough then this solves the latency problem of the rendez vousapproach. However, if the queues fill up then the process stalls and ineffect the communications fall back to the rendez vous approach. Toreduce the chance of this the queues need to be made long compared tothe amount of data likely to be transmitted. But queues incur asignificant silicon footprint, especially in an array of many potentialcombinations of senders and receivers. Also, in practice the queuescannot be made indefinitely long.

Bulk synchronous parallel (BSP) provides a third way: each tile performsa certain defined amount of compute processing in a compute phase, thenall tiles synchronize together (a barrier synchronization) beforeadvancing to an exchange phase. This does not incur as much latency asthe rendez vous approach, and does not incur as much queuing as thepost-box approach.

An example use of multi-threaded and/or multi-tiled processing is foundin machine intelligence. As will be familiar to those skilled in the artof machine intelligence, a machine intelligence algorithm is basedaround performing iterative updates to a “knowledge model”, which can berepresented by a graph of multiple interconnected nodes. Each noderepresents a function of its inputs. Some nodes receive the inputs tothe graph and some receive inputs from one or more other nodes, whilstthe output of some nodes form the inputs of other nodes, and the outputof some nodes provide the output of the graph (and in some cases a givennode may even have all of these: inputs to the graph, outputs from thegraph and connections to other nodes). Further, the function at eachnode is parameterized by one or more respective parameters, e.g.weights. During a learning stage the aim is, based on a set ofexperiential input data, to find values for the various parameters suchthat the graph as a whole will generate a desired output for a range ofpossible inputs. Various algorithms for doing this are known in the art,such as a back propagation algorithm based on stochastic gradientdescent. Over multiple iterations based on the input data, theparameters are gradually tuned to decrease their errors, and thus thegraph converges toward a solution. In a subsequent stage, the learnedmodel can then be used to make predictions of outputs given a specifiedset of inputs or to make inferences as to inputs (causes) given aspecified set of outputs.

The implementation of each node will involve the processing of data, andthe interconnections of the graph correspond to data to be exchangedbetween the nodes. Typically, at least some of the processing of eachnode can be carried out independently of some or all others of the nodesin the graph, and therefore large graphs expose great opportunities forconcurrency and/or parallelism.

SUMMARY

It is recognized herein that, in a scenario where two or more processorsare operating in a synchronized manner, it would be desirable to enableone processor to prepare in advance of the next barrier for atransaction that the other processor is going to perform following thatbarrier. Consider a case where a first processor (e.g. host CPU) iscoupled to a second processor (e.g. an accelerator processor), and atleast the second processor is configured to operate over a series ofsteps or stages (e.g. BSP supersteps) which are synchronized with thefirst processor by means of a series of barrier synchronizations. Thatis, the second processor has to wait for agreement from first processorbefore the second processor can proceed to its next stage of execution.This may be referred to in the art as a barrier. E.g. to pass thebarrier the second processor raises a sync request to indicate it isready to advance to the next step, and then must wait for a syncacknowledgment in response before it can proceed. After the barrier, thesecond processor may request to perform an interaction with the firstprocessor, which could involve, for example, the first processor needingto ensure some space is reserved in its own memory for the transaction,or ensuring that the requested data is generated in the case of atransfer from the first to the second processor. This preparation needsto be performed before the interaction can occur. It will thereforeincur some delay before the interaction can occur if not performedalready. However, if the first processor could know about the upcominginteraction before the barrier, it could perform some or all of thenecessary preparation.

Such scenarios can even occur in the case of a statically compiled graphwhere the code run on the two (or more) processors has been pre-compiledto operate together, since some interactions between processors may bedata dependent. I.e. the compiler cannot necessarily know which type ofinteraction the second processor is going to perform in step s+1 socannot predetermine what preparations the first processor should make instep s, because the type of interaction that the second processor is toperform in step n may depend on, e.g., the result of a calculation, apseudorandom number or an external stimulus.

Similar situations can also occur more generally when a first subsystemcomprising one or more first processors interacts with a secondsubsystem comprising one or more second processors, where at least oneof the second processors is to interact with at least one of the firstprocessors. For instance the second subsystem may comprise an array ofaccelerator processors (XPUs), and/or the first subsystem may comprise ahost CPU and one or more gateway processors for acting as a gatewaybetween host CPU and the accelerator(s).

To address the above situations or similar, the present disclosureprovides a mechanism whereby, in a particular step (where steps aredelineated by barrier synchronizations), a second processor (e.g. XPU)sends the first processor (e.g. host CPU or gateway) a descriptor of thesecond processor's intended interactions with the first processor. Thefirst processor can then prepare for the next step accordingly, such asto prepare its memory. For instance this may comprise reserving asuitable portion of memory, or ensuring the required data is generatedand stored in memory in the case of a transfer from first to secondprocessor. The descriptor specifies one of a set of predeterminedinteractions, which may be pre-compiled by the compiler. E.g. the secondprocessor tells the first it is going to read from a certain specifiedstream, or that it is going to write to a certain specified stream. Forinstance the streams could be sequences of images, audio streams, orother experience data which are being used for machine learning, such asto train a neural network. The first processor (e.g. host) can then usethe information on the specified interaction, for instance, to ensurethe pipe is kept full or to pull data out of the pipe accordingly.

According to one aspect disclosed herein there is provided a processingsystem comprising a first subsystem comprising one or more firstprocessors, and a second subsystem comprising one or more secondprocessors. The second subsystem is configured to process code over aseries of steps, each next step in the series being delineated from itspreceding step by a barrier synchronization whereby the second subsystemwaits to advance to the next step until the second subsystem receives asynchronization acknowledgement signal indicating that the advancementis agreed by the first subsystem. The second subsystem is furtherconfigured, in a current one of said steps, to send a descriptor to thefirst subsystem specifying a value of each of one or more parameters ofeach of one or more interactions that the second subsystem is programmedto perform with the first subsystem via an inter-processor interconnectin a subsequent one of said steps. The first subsystem is configured toexecute a portion of code to perform one or more preparatory operations,based on the specified values of at least one of the one or moreparameters of each interaction as specified by the descriptor, toprepare for said one or more interactions prior to the barriersynchronization leading into said subsequent step.

In embodiments, the first subsystem may store one or more look-up tablesmapping each of a set of behaviour IDs to a different respective one ofa plurality of different possible predetermined definitions for saidinteraction, each definition comprising a respective set of values forsaid one or more parameters. In this case the descriptor specifies thespecified values of the one or more parameters of each interaction byindicating one of the behaviour IDs; and the first subsystem isconfigured to determine the specified values by looking up thedefinition mapped to the indicated behaviour ID in said one or morelook-up tables, and to perform said one or more preparatory operationsbased on the respective set of values of the looked-up definition.

In embodiments, at least one of the one or more interactions may be totransfer data between the second subsystem and a memory of the firstsubsystem, and the one or more preparatory operations may comprise oneor more operations to prepare the memory for the transfer.

In embodiments, the at least one parameter may comprise a direction ofthe transfer, the direction being either: incoming from the secondsubsystem to the memory of the first subsystem, or outgoing from thememory of the first subsystem to the second subsystem.

In embodiments, the transfer may comprise transferring an incomingportion of data from the second subsystem to the memory of the firstsubsystem, and said at least one parameter may comprise at least a sizeof the incoming portion of data. In this case, said one or morepreparatory operations may comprise at least: reserving a correspondingamount of space in the memory ready to accept the incoming portion ofdata from the second subsystem in the subsequent step.

In embodiments, the transfer may comprise transferring an outgoingportion of data to the second subsystem from the memory of the firstsubsystem, and said at least one parameter may comprise at least a sizeof the outgoing portion of data. In this case, said one or morepreparatory operations may comprise one, more or all of: reserving acorresponding amount space in the memory to store the outgoing portionof data, generating the outgoing portion of data, and storing theoutgoing portion of data in the memory ready to send to the secondsubsystem in the subsequent step.

In embodiments, the memory may comprise a FIFO buffer and the reservedspace is space in the FIFO.

In embodiments, at least one of said one or more interactions may be totransfer the data as part of a stream; and the one or more parametersfor each stream may comprise at least a stream ID identifying a stream,an indication that the second subsystem is to begin streaming betweenthe second subsystem and the memory of the first subsystem in thesubsequent step, and a direction of the stream.

In embodiments, the stream ID may be mapped to the behaviour ID in afirst of said look-up tables, and the portion size and direction may bemapped to the stream ID in a second of said look-up tables.

In embodiments, said subsequent step may be the next step following thecurrent step in said series by default. Alternatively, said subsequentstep may be operable to be any of a number of steps following thecurrent step in said series. Said number may be specified by thedescriptor.

In some embodiments, the descriptor may specify at least one interactionfor each of the next N steps following the current step in said series,where N is specified by the descriptor. In this case, the firstsubsystem is configured to prepare for each of said N steps prior to therespective barrier leading into each.

In embodiments, the processing system may further comprisesynchronization logic configured to return the synchronizationacknowledgement signal to the second subsystem on condition of: i)receiving a synchronization request signal from the second subsystem,and ii) receiving permission from the first subsystem system to returnthe synchronization acknowledgement.

In embodiments, the synchronization logic may comprise a register forstoring a number of credits, the register being writeable by the firstsubsystem. In this case, said permission is granted when the register iswritten with at least one credit but denied when the credits areexhausted, and the synchronization logic is configured to automaticallydecrement the number of credits in the register each time an instance ofthe synchronization acknowledgement signal is returned to the secondsubsystem.

In embodiments, each of the one or more second processors may comprisean array of tiles each comprising a respective execution unit andmemory, the tiles being arranged to exchange data with one another by aninter-tile interconnect.

In embodiments, the inter-tile interconnect may be a time-deterministicinterconnect for exchanging data between the tiles in atime-deterministic manner; but the inter-processor interconnect may be anon-time-deterministic interconnect for performing said exchange of databetween the first subsystem and second subsystem only in anon-time-deterministic manner.

In embodiments, the first second subsystem may be configured to sendsaid synchronization request on condition of receiving an individualrequest for synchronization from each of the tiles.

In embodiments, the second subsystem may comprise a plurality of secondprocessors configured to communicate via the inter-processorinterconnect.

In embodiments, the second subsystem may be configured to send saidsynchronization request on condition of receiving an individual requestfor synchronization from each of said plurality of second processors.

In embodiments, the first subsystem may comprise a host subsystem, theone or more first processors comprising at least one host CPU andoptionally one or more gateway processors arranged as a gateway betweenthe host CPU and the second subsystem; and the second subsystem maycomprise an accelerator subsystem, the one or more second processorscomprising one or more accelerator processors arranged to perform workallocated by the host CPU.

In embodiments, each of said steps may comprise a bulk synchronousparallel, BSP, superstep. In this case, each superstep comprises anexchange phase following the barrier synchronization, wherein in theexchange phase the first and second subsystems perform said interaction.Each superstep then comprises a compute phase following the exchangephase, wherein in the exchange phase the first and second subsystemsperform only computations or internal exchanges but not exchangesbetween the first and second subsystems. The next barriersynchronization follows the compute phase.

In embodiments, the code on the second subsystem and the portion of codeon the first subsystem may be statically pre-compiled to operatetogether to perform said interaction.

According to another aspect disclosed herein there is provided method ofoperating a system comprising a first subsystem comprising one or morefirst processors, and a second subsystem comprising one or more secondprocessors, the method comprising: arranging the second subsystem toprocess code over a series of steps, each next step in the series beingdelineated from its preceding step by a barrier synchronization wherebythe second subsystem waits to advance to the next step until the secondsubsystem receives a synchronization acknowledgement signal indicatingthat the advancement is agreed by the first subsystem; in a current oneof said steps, sending a descriptor from the second subsystem to thefirst subsystem specifying a value of each of one or more parameters ofeach of one or more interactions that the second subsystem is programmedto perform with the first subsystem via an inter-processor interconnectin a subsequent one of said steps; and on the first subsystem, executinga portion of code to perform one or more preparatory operations, basedon the specified values of at least one of the one or more parameters ofeach interaction as specified by the descriptor, to prepare for said oneor more interactions prior to the barrier synchronization leading intosaid subsequent step.

According to another aspect disclosed herein there is provided acomputer program embodied on computer-readable storage and configured soas when run on a system comprising a first subsystem comprising one ormore first processors, and a second subsystem comprising one or moresecond processors, to perform operations of: controlling the secondsubsystem to run at least part of the program over a series of steps,each next step in the series being delineated from its preceding step bya barrier synchronization whereby the second subsystem waits to advanceto the next step until the second subsystem receives a synchronizationacknowledgement signal indicating that the advancement is agreed by thefirst subsystem; in a current one of said steps, controlling the secondsubsystem to send a descriptor to the first subsystem specifying a valueof each of one or more parameters of each of one or more interactionsthat the second subsystem is programmed to perform with the firstsubsystem via an inter-processor interconnect in a subsequent one ofsaid steps; and controlling the first subsystem to perform one or morepreparatory operations, based on the specified values of at least one ofthe one or more parameters of each interaction as specified by thedescriptor, to prepare for said one or more interactions prior to thebarrier synchronization leading into said subsequent step.

BRIEF DESCRIPTION OF THE DRAWINGS

To aid understanding of the present disclosure and to show howembodiments may be put into effect, reference is made by way of exampleto the accompanying drawings in which:

FIG. 1 is a schematic block diagram of a multi-threaded processing unit,

FIG. 2 is a schematic block diagram of a plurality of thread contexts,

FIG. 3 schematically illustrates a scheme of interleaved time slots,

FIG. 4 schematically illustrates a supervisor thread and plurality ofworker threads,

FIG. 5 is a schematic diagram of logic for aggregating exit states ofmultiple threads,

FIG. 6 schematically illustrates synchronization amongst worker threadson the same tile,

FIG. 7 is a schematic block diagram of a processor chip comprisingmultiple tiles,

FIG. 8 is a schematic illustration of a bulk synchronous parallel (BSP)computing model,

FIG. 9 is another schematic illustration of a BSP model,

FIG. 10 is a schematic illustration of BSP between multi-threadedprocessing units,

FIG. 11 is a schematic block diagram of an interconnect system,

FIG. 12 is a schematic illustration of system of multiple interconnectedprocessor chips,

FIG. 13 is a schematic illustration of a multi-tier BSP scheme,

FIG. 14 is another schematic illustration of a system of multipleprocessor chips,

FIG. 15 is a schematic illustration of a graph used in a machineintelligence algorithm,

FIG. 16 schematically illustrates an arrangement for exchanging databetween tiles,

FIG. 17 schematically illustrates a scheme of exchange timings,

FIG. 18 illustrates example wiring for synchronizing between chips, and

FIG. 19 schematically illustrates a flow control mechanism for externalexchange,

FIG. 20 schematically illustrates a program flow involving a host syncproxy,

FIG. 21, is a schematic block diagram of a host subsystem andaccelerator subsystem,

FIG. 22 is another schematic block diagram of a host and acceleratorsubsystem,

FIG. 23 is a schematic illustration of a descriptor sent from anaccelerator to a host, and

FIG. 24 schematically illustrates an example exchange between host andaccelerator,

FIG. 25 schematically illustrates another exchange between host andaccelerator, and

FIG. 26 schematically illustrates an exchange via a gateway.

DETAILED DESCRIPTION OF EMBODIMENTS

FIG. 21 shows an example system in accordance with embodiments of thepresent disclosure. The system comprises a first processing subsystem 93comprising at least one first processor, and a second processingsubsystem 300 comprising one or more second processors 2. The firstsubsystem 93 may be a host subsystem and the second subsystem may be anaccelerator subsystem. That is, the at least one first processor may bea host processor (host CPU) 93H configured with the role of a host, forallocating work; and each of the one or more second processors 2 may bean accelerator processor (“XPU”), i.e. a co-processor which is arrangedto perform work allocated by the host processor 93H. The host processor93H is privileged and the accelerator devices 2 undertake work delegatedby the host processor 93H. In embodiments each of the acceleratorprocessors 2 may take the form of an IPU (“Intelligence ProcessingUnit”) designed specially for use as a machine intelligence acceleratorprocessor.

Embodiments below will be described in terms of the first subsystem 93taking the role of a host subsystem and the second subsystem 300 takingthe role of an accelerator subsystem. Embodiments will also be describedin terms of the accelerator subsystem 300 comprising a plurality ofsecond processors 2. However it will be appreciated that such featuresare not necessarily limiting, and more generally the teachings below canapply to any arrangement of a first subsystem 93 comprising one or morefirst processors (e.g. 93H) and a second subsystem 300 comprising one ormore second processors 2, where the first and second subsystemssynchronize by means of a barrier synchronization, and wherein at leastone of the one or more second processors is to perform an interactionwith at least one of the one or more first processors following thebarrier.

The multiple accelerator processors 2 are connected together by aninter-processor interconnect 72. For instance each of the processors 2may be implemented on a separate chip (die) and the inter-processorinterconnect 72 may take the form of an external interconnect, i.e.inter-chip interface. The chips could be packaged on the same integratedcircuit (IC) package, or different packages, or some on the same packageand some on different packages. The inter-processor interconnect 72 alsoconnects the accelerator processors 2 to the host processor 93H via asuitable host interface 97 such as a PCI, PCIe or Ethernet interface.The inter-processor interconnect 72 comprises a network of data paths301 for exchanging data between accelerator processors 2 and/or betweenaccelerator 2 and host processor 93H.

The interconnect 72 also comprises a mechanism for synchronizing betweenthe processor(s) 93H of the host subsystem 93 and the processor(s) 2 ofthe accelerator subsystem 300, and in embodiments also for synchronizingbetween the accelerator processors 2 of the accelerator subsystem 300.In embodiments this mechanism takes the form of a synchronization (sync)network 96 separate from the data paths 301 of the inter-processorinterconnect 72. Examples of this will be discussed in more detailshortly.

In embodiments the inter-processor interconnect 72 is anon-time-deterministic interconnect, in that the transmission of dataover the data paths 301 of this interconnect 72 (as opposed to syncsignalling over the sync network 96) is non-time-deterministic innature. I.e. the timing cannot be known or at least not guaranteed, e.g.because delivery is not guaranteed and therefore may requireretransmission. An example of a non-time-deterministic interconnect 72will be discussed later in more detail with reference to FIG. 19.

The host processor 93H comprises a respective processing unit 305H andmemory 306H. Each of the accelerator processors 2 also comprises atleast one respective processing unit and memory. In embodiments, each ofone, some or all of the accelerator processors 2 may comprise arespective array of tiles 4. In embodiments the tiles 4 of a givenprocessor 2 are implemented on the same chip (die) as one another. Eachtile 4 comprises a respective processing unit 10 and memory 11, examplesof which are discussed in more detail later with reference to FIG. 1. Inembodiments the processing unit 10 on each of the tiles 4 is amultithreaded processing unit 10 for running multiple concurrent threadson the tile 4. The tiles 4 are connected together via an internal,inter-tile interconnect 34 which enables transfer of data between tiles4. In embodiments the inter-tile interconnect 34 may be atime-deterministic interconnect, enabling time-deterministic exchange ofdata between tiles 4. An example implementation of this will bedescribed in more detail later with reference to FIGS. 16 and 17. Theinternal interconnect 34 may also enable synchronization between tiles4. Further example details of this will be discussed in relation to,e.g., FIGS. 7 and 11

FIG. 22 illustrates an example variant of the system shown in FIG. 21.Here the host subsystem 93 comprises a plurality of first processors,e.g. a host processor (host CPU) 93H and one or more gateway processors93GW. The host processor 93H comprises a respective processing unit 305Hand memory 306H as described in relation to FIG. 21. Each of the gatewayprocessors 93GW also comprises a respective processing unit 305GW andmemory 306GW. The one or more gateways 93GW are arranged asintermediaries between the host CPU 93H and the accelerator processors2. Each gateway 93GW is connected to one or more of the acceleratorprocessors 2 via the host interface 97 and the inter-processorinterconnect 72. E.g. each gateway 93 may be connected to a differentrespective subset of the accelerators 2 (consisting of one or more ofthe accelerators 2) via a respective instance of the host interface 97and a different respective part of the inter-processor interconnect 72,as shown. Alternatively it is not excluded that a given accelerator 2could connect to the host subsystem 93 via multiple gateways 93GW.Either way, each of the gateways 93GW is connected on the other side tothe host CPU 93H. This connection may for example be via a host network302, e.g. a PCI, PCIe or Ethernet network. One or more of the gateways93GW may also be connected to one or more network attached storagedevices (NASs) 303, i.e. storage drives such as hard disks or flashdrives. For example the NASs may also be connected on the host network302.

The gateway(s) 93GW may have any one or more of a number of roles. Forinstance, in embodiments, one or more of the gateways 93GW are arrangedto act as buffers for streams of data such as sequences of images, audiostreams or other streams of experience data which are to be streamed tothe accelerator processors 2 in order for the accelerators 2 to conductmachine learning based thereon; e.g. to train a neural network toidentify objects, faces, sounds, or other structures in the receivedexperience data. The use of the gateway 93GW in this way may bedesirable since it relieves the resources of host memory 305H. Insteadat least some of the data destined for the accelerators 2 is buffered inthe respective memory 306GW of the gateway(s) 93GW in question. In somecases the gateway(S) 93GW may be arranged to retrieve some or all of thestreams directly from one or more of the NASs 303, e.g. via the hostnetwork 302, rather than the data having to go through the host memory305H.

Alternatively or additionally, in embodiments one or more of thegateways 93GW may be arranged to pre-process the data (e.g. streams ofexperience data) prior to supply to the accelerator processors 2. Forinstance this pre-processing may comprise decoding, decrypting and/orconditioning the data. E.g. in the latter case, the conditioning maycomprise adding deliberate pseudorandom noise to the experience data.This is known to help improve the ability of a machine learningalgorithm (in this case run on the accelerators 2) to formgeneralizations from the experience data rather than just memorize theexperience data. Offloading such pre-processing to the gateway(s) 93GWadvantageously relieves the host CPU 93H from such tasks.

The following teachings may apply to an arrangement such as that shownin FIG. 21 with a single host or first processor 93H, or an arrangementsuch as that shown in FIG. 22 with multiple processors in the host orfirst subsystem 93, e.g. a host CPU 93H and one or more gateways 93GW.FIGS. 21 and 22 are included for illustrative purposes and should not beconstrued as limiting.

As mentioned, the accelerator subsystem 300 is configured to synchronizewith the host subsystem 93 according to a scheme of barriersynchronizations. This means that the processing performed by theaccelerator subsystem 300 is performed over a series of steps, whereinthe steps are delineated by synchronization barriers. In each step, eachprocessor of the accelerator subsystem 300 performs some respectiveprocessing assigned to that step, e.g. by the compiler. The processingperformed in the current step by the accelerator subsystem 300 isprocessing that it can perform without waiting for the host subsystem 93to agree that the system can advance past the next barrier to the nextstep.

In embodiments, each of these steps may be a system-level BSP supersteps. E.g. see FIG. 20. That is, at the beginning of each step there is anexchange phase 50″ in which the host subsystem 93 and acceleratorsubsystem 300 exchange data with one another, and then in that same stepfollows a compute phase 52″ where the accelerator subsystem 300 performsprocessing only internally to the accelerator subsystem 300 and the hostsubsystem 93 performs processing only internally to the host subsystem93. The accelerator subsystem 300 is not allowed to proceed to the nextexchange phase 50″ until both the subsystems 93, 300 have indicatedreadiness or agreed for the next barrier 90 to be passed. Theaccelerator subsystem indicates its readiness to sync by issuing a syncrequest, then pauses until it receives back a sync request. This will bedescribed in more detail shortly.

Note however that the host 93 does not necessarily have to stop and waitfor the sync request from the accelerator subsystem 300. It maysometimes stop and wait for a sync request from the accelerators 300 butdoesn't have to. Since the host 93 syncs it can be said to beparticipating in the BSP system, but that does not mean every process onthe host 93 has to stop at every sync point.

Note also: as well as computations, the system-level compute phase 52″(the compute phase from the perspective of the synchronization andinteractions between the host and accelerator subsystems 93, 300) mayalso comprises exchanges between processors 2 internally within theaccelerator subsystem 300, and/or exchanges between processors 93H, 93GWinternally within the host subsystem 93.

In embodiments, each of the system-level BSP supersteps s may compriseone or more lower-level supersteps, such as accelerator subsystemsupersteps p within the accelerator subsystem 300. I.e. the system-levelcompute phase 52″ may comprise one or more lower level BSP supersteps,each comprising exchange 50′ amongst the second processors 2 (e.g.accelerators) followed by compute 52′ within each second processor 2.Also, the compute phase 52′ from the perspective of this lower level BSPsuperstep may comprise one or more even lower level BSP supersteps,comprising exchange 50 amongst the tiles 4 internally to each secondprocessor 2, followed by a compute phase 52 within each tile. Thedifferent levels of compute phase could be referred to as a systemcompute phase 50″, processor (or accelerator) compute phase 50′, andtile compute phase 50. Examples will be discussed in more detail laterwith reference to FIGS. 8 to 10 and 13. In embodiments, the hostprocessor 93H, gateway(s) 93GW and/or network storage devices 303 may beallowed to communicate asynchronously over the host network 302 duringthe system compute phase 50′. I.e. no internal synchronization isnecessarily required within the host subsystem 93.

To synchronize between the accelerator subsystem 300 and host subsystem93, the accelerator subsystem 300 raises a synchronization request(“sync request”, or sync_req) over the sync network 96. This indicatesthat the accelerator subsystem 300 has reached a point where it has tosync with the host subsystem before proceeding past the current barrier90 to the next step s+1. E.g. the accelerator subsystem 300 hascompleted its compute phase 52″ for the current BSP superstep s andthere is now no processing left that it is allowed to do until it hasreceived agreement form the host subsystem 93 to advance to the exchangephase 52″ of the next BSP superstep s+1. The sync request may be sentover the sync network 96 in response to execution of a dedicated syncinstruction by the accelerator subsystem 300, i.e. one of the machinecode instructions defined in the instruction set of the acceleratorprocessors 2.

In the case of multiple accelerator processors 2, the sync network 96 inthe inter-processor interconnect 72 may comprise sync logic 76configured to aggregate a local sync request from each of a group ofsome or all of the accelerator processors 2 (a sync group), and to raisethe (globally aggregated) sync request to the host subsystem 93 oncondition of receiving the local sync requests from all of theaccelerator processors 2 in the sync group. The local sync requests maybe sent in response to execution of an instance of the sync instructionon each of the accelerator processors 2 in the sync group. Inembodiments the membership of the sync group is settable, e.g. fromamongst multiple different hierarchal levels of groupings. Inembodiments the sync group is a mode of the sync instruction (i.e. setby an operand of the sync instruction). This will be discussed in moredetail later, e.g. in relation to FIG. 14.

In the case of multiple tiles 4 on a given accelerator processor 2, theinternal interconnect 34 may comprise sync logic 36 configured toaggregate individual sync requests from some or all of the tiles 4 onthe accelerator processor 2 (the participating tiles), and to raise the(locally aggregated) sync request from the accelerator processor 2 oncondition of receiving the individual sync requests from each of theparticipating tiles 4. In embodiments each of the individual syncrequests raised by the tiles 4 is the result of executing an instance ofthe dedicated sync instruction on the respective tile 4, e.g. by asupervisor thread running on the tile 4. This will again be discussed inmore detail later.

The host processor 93H causes a synchronization acknowledgement (“syncacknowledgment”, or sync_ack) to be returned to the acceleratorsubsystem 300, over the sync network 96, in response to the sync requestfrom the accelerator subsystem 300 (e.g. the aggregated sync request inthe case of multiple accelerator processors 2). The host processor 93Hcould do this by sending the sync ack directly. However, this mayrequire the host processor 93H to be specially configured to connect tothe sync network 96. It would be desirable if a general purposeprocessor such as a general purpose CPU could be used as the host 93H.Therefore to accommodate this, in embodiments the mechanism for thesynchronization between the host and accelerator subsystems 93, 300employs a component referred to herein as a “host sync proxy” (HSP) 98.

The host sync proxy 98 is a piece of hardware logic in theinter-processor interconnect 72 that comprises a counter 99. The counter99 comprises register arranged to hold a number of sync credits, alsoreferred to herein as “marks”. The host subsystem 93 (e.g. hostprocessor 93H) can write a number of credits or marks to the counter ofthe HSP 98. The HSP 98 is arranged to receive the sync request from theaccelerator subsystem 300 (this being the globally aggregated syncrequest in the case of multiple accelerator processors), and to returnthe sync acknowledgment back to the accelerator subsystem in dependenceon the number of credits currently in the counter 99. The logic of theHSP 98 is configured to operate as follows. When the HSP 98 receives async request from the accelerator subsystem 300 and the number ofcredits in the counter 99 is not exhausted, then the HSP 98 willautomatically respond with a sync acknowledgement on behalf of the hostsubsystem 93 and automatically decrement the counter by one credit. Ifon the other hand the number of credits in the counter 99 is exhaustedwhen the sync request is received from the accelerator subsystem 300,then the HSP 98 will not return the sync acknowledgement until the hostsubsystem 93 (e.g. host processor 93H) writes at least one more creditto the counter 99. Thus the host subsystem 93 can control whether or notthe accelerator subsystem 300 advances past the next sync barrier, andwhen, by means of writing to the register 99. In embodiments the HSP 98may comprise different counters 99 for different sync groups. This willbe discussed in more detail later in relation to FIGS. 14 and 18.

In the case of a gateway 93GW, the HSP 98 may be implemented in thegateway 93GW itself (e.g. same chip) rather than externally in theinter-processor interconnect 72. Or equivalently, this part of thegateway chip may be considered a part of the inter-processorinterconnect 72 that extends into the chip of the gateway 93GW. It willbe appreciated that the distinction is only conceptual. In suchembodiments where the HSP 98 is integrated into the same chip as thegateway 93GW, the gateway 93GW may connect to the accelerator side ofthe external interconnect 72 via a suitable interface such as an PCI,PCIe or Ethernet interface. Tunneling via the PCI, PCIe or Ethernetprotocol may be used to send the sync requests and acks via such aninterface. Alternatively the gateway 96GW could be provided with adedicated, bespoke connection to the sync network 96.

Alternatively the HSP 98 could be implemented as part of theinterconnect 72 external to the chip(s) of the gateway(s) 93GW. In thecase where the host subsystem 93 comprises multiple gateways 93GW, theHSP 98 may comprise multiple HSP instances each comprises a respectivecounter 99, with each instance being arranged to receive the syncrequest from a respective subset of one or more of the acceleratorprocessors 2, and each instance being configured to govern the return ofthe sync acknowledgements to its own respective subset of accelerators 2in dependence on the credits in its respective counter (in the samemanner as discussed previously but with respect to the respective subsetof accelerators 2). In such embodiments where the HSP 98 is external tothe chip of the gateway 93GW and instead incorporated on the acceleratorside of the interconnect 72, then the gateway 93GW may write synccredits to the counter register 99 via a suitable interface such as aPCI, PCIe or Ethernet interface, analogous to the host CPU 93H in FIG.21.

In either case, it may be the host CPU 93H or the respective gateway93GW or both that have the ability to write credits to the counter(s)99, depending on implementation.

In the case of multiple gateways 93GW, these may be able to propagatesync requests and acknowledgments between them to form sync groupslarger than the accelerators 2 connected to just one single gateway 93W.The gateways 93W may be connected to one another via the host network302, e.g. a PCI, PCIe or Ethernet network, and the sync requests andacks may be communicated between gateways 93GW by tunneling via thisnetwork and protocol. Alternatively the hosty network 302 could includea dedicated, bespoke connection between the gateways 32GW comprising anextension of the sync network 96 (not shown). In general the hostnetwork 302 is not limited to any particular protocol or topology.

As mentioned, in embodiments, the host processor 93H, gateway(s) 93GWand/or network storage devices 303 may be allowed to communicateasynchronously over the host network with no internal synchronizationbeing required within the host subsystem 93. Alternatively, in someembodiments, there may be a separate system of credits (not shown) thatallows the gateways 93GW to communicate autonomously with one another,the NASs 303 and/or the accelerators 2 for only a credited number ofsteps before requiring further involvement from the host CPU 93H. Thatis, when the number of these credits is not exhausted the gateways 93GWare allowed to communicate with the NAS(s) 303 and/or acceleratorsubsystem 300, but when these credits are exhausted then the gateways93GW are allowed to communicate with the NAS(s) 303 and/or acceleratorsubsystem 300 until the host CPU 93H has written at least one more ofthese credits.

By whatever mechanism the synchronization between the host andaccelerator subsystems 93, 300 is implemented, at some point theaccelerator subsystem 300 will reach a point where its processor(s) 2cannot continue their processing (cannot continue running their parts ofthe program) until they receive agreement from the host subsystem 93that the accelerator program can proceed to the next step. I.e. abarrier 90 is reached. E.g. the accelerator subsystem 300 may need towait for a sync ack from the HSP 98, which will not be granted until thehost subsystem 93 writes to the register 99. At the same time, the hostsubsystem 93 may have tasks that it cannot perform until the acceleratorprocessor 300 advances to the next step s+1, e.g. because it isdependent on some interaction with the accelerator subsystem 300. Thehost subsystem's resources may also be underutilized in the current steps relative to the next step s+1.

To mitigate such scenarios or similar, embodiments of the presentdisclosure provide a mechanism whereby a processor 2 of the acceleratorsubsystem 300 can send a descriptor to a processor 93H/GW of the hostsubsystem 93 in the current step s (which is received by the processor93H/GW of the host subsystem 93 in the current step), informing theprocessor 93H/GW of the host subsystem 93 about one or more interactionsthat the accelerator processor 2 intends to perform in the next step s+1(i.e. once the next barrier 90 is crossed). The descriptor may be sentvia the data paths 301 of the interconnect 72, and via the hostinterface 97; or alternatively it is not excluded that it could be sentby another, side channel (not shown). By whatever means sent, thereceiving processor 93H/GW of the host subsystem 93 can then use thisdescriptor to prepare for the interaction while the second subsystem 300is still operating in the present step s, e.g. to prepare the hostmemory 306 such as by reserving space in memory 306 or ensuring outgoingdata is generated and stored in the memory 306. This advantageouslysaves time since, when the accelerator subsystem 300 comes to actuallyrequest the interaction in the next step s+1, then some or all of thenecessary preparation has already been performed, rather than having tobegin only after being triggered by the request itself.

In embodiments such as those shown in FIG. 21, the descriptor is sentto, and used by, the host processor 93H in preparation for aninteraction with that processor. In embodiments such as those shown inFIG. 22, the descriptor may be sent to, and used by, the host CPU 93Hand/or one or more of the gateways 93GW in preparation for aninteraction with that/those processor(s). The following may be describedin terms of one of the tiles 4 in one of the accelerators 2 of theaccelerator subsystem 300 interacting with the host processor or CPU 93Hof the host subsystem 93 of FIG. 21 or 22. However it will beappreciated that, more generally, the teachings below may apply to anysingle or multi-tile processor 2 of a second processing subsystem 300interacting with any host, gateway or other processor of a firstprocessing subsystem 93.

Reference is made to FIG. 23. The descriptor specifies a value for eachof a set of one or more parameters describing the intendedinteraction(s) for the next step s+1 (i.e. after the nextsynchronization barrier 90). The interaction may comprise a transfer ofdata between a memory 11 of the accelerator processor 2 (e.g. on one ofits tiles 4) and the memory 306H of the host processor 93H (or memory306GW of the gateway 93GW). The direction of the transfer may beincoming (input) to the memory 306 of the host processor 306H, oroutgoing (output) from the memory 306 of the host 93H/GW (note thereforethat the direction of the transfer is named from the perspective of thehost memory 306 for the present purposes). Note also that inembodiments, the descriptor may specify multiple such interactions inone or both directions for a given step.

For each interaction, the parameters specified may for example compriseany one, more or all of: I) a direction of the transfer; II) a size(amount) of the data to be transferred in the next step e.g. in bytes;and/or III) an identifier of the item of content to which the data beingtransferred belongs, e.g. a stream ID identifying a stream. Inembodiments the parameters may comprise an indication that the stream isto begin being streamed in the next step.

The stream to be transferred may for example comprise a sequence ofimages (individual still images or video frames), or an audio stream ofone or more audio samples, or any other sequence of experience data(e.g. online shopping habits, etc.) which is being sent from the hostsubsystem 93H to the accelerator subsystem 300 in order for theaccelerator subsystem 300 to use as inputs to a machine learning ormachine intelligence algorithm run on the accelerator subsystem 300. Forexample this could be to train a neural network based on the streameddata, or to make inferences from the data based on an already-trainedneural net. In an example where the stream is in the direction fromaccelerator subsystem 300 to host subsystem 93, the stream couldcomprise a stream of inferences resulting from a machine intelligencealgorithm such as a trained neural net run on the accelerator subsystem300.

In response to receiving the descriptor, software running on the hostprocessor 93H (or gateway 93GW) performs one or more preparatory actionsin the current step s to prepare for the transfer of the data in thenext step s+1. This may comprise talking one or more actions to preparethe memory 306H of the host processor 93H for the transfer (or similarlyfor a gateway). In the case of a transfer from accelerator 2 to host 93(e.g. one of the tiles 4 to the host processor 93H or gateway 93GW),then the preparation by the host 93H may comprise reserving space in thehost memory 306H for the incoming data (or the gateway 93GW reservingspace in the gateway memory, etc.). This may be based on the fact thatthe descriptor specifies the direction of the transfer as incoming. Inembodiments, the reservation may comprise reserving a portion of thehost memory 306 at least equal to the size specified by the descriptor.In the next step, when the transfer actually happens, the host processor93H (or gateway 93GW accordingly) may then store the received portion ofdata as part of the data item (e.g. stream or file) specified by thedescriptor.

In the case of a transfer from host 93 to accelerator 2 (e.g. the hostprocessor 93H or gateway 93GW to one of the tiles 4), then thepreparation by the host 93H may comprise any one, more or all of thefollowing actions. It may comprise reserving space in the host memory306H for the outgoing data (or the gateway 93GW reserving space in thegateway memory, etc.). And/or, the preparation may comprise generatingthe outgoing data or fetching it from the data item (e.g. stream orfile) identified by the descriptor. And/or, the preparation may comprisepre-processing the outgoing data (e.g. decrypting, decoding, orpreconditioning it such as to add deliberate pseudorandom noise).And/or, the preparation may comprise storing the generated or outgoingdata in the host memory 306, e.g. in the reserved space in memory. Thismay be based on the fact that the descriptor specifies the direction ofthe transfer as outgoing. In embodiments, again the reservation maycomprise reserving a portion of the host memory 306 at least equal tothe size specified by the descriptor.

In embodiments the host memory 306 (e.g. the memory of the hostprocessor 93H or the memory 306GW of a gateway processor 93GW) maycomprise at least one first-in, first-out (FIFO) buffer 308. This may beemployed for example in the case of streaming over multiple steps. Forinstance the FIFO 308 may comprise a circular FIFO. In the case of aFIFO 308, the reserving comprises ensuring that a suitably sized spaceis kept free in the FIFO, e.g. at least equal in size to the sizespecified by the descriptor. In embodiments the host memory comprisesmultiple FIFOs, e.g. an input FIFO and output FIFO. For an incomingstream the reserving may comprise reserving space in the input FIFO(incoming to the host), and for an outgoing stream the reserving maycomprise reserving space in the outgoing FIFO).

Any the values of any parameters not specified by the descriptor may, inother embodiments, be defaults, or may be specified in the next step s+1by the actual request from the accelerator 2 for the transaction.

In embodiments the descriptor takes the form of at least one behaviourID which maps to values of the one or more parameters at the host side93 (rather than the specified value(s) of the parameter(s) beingexplicitly coded into the descriptor). This is the preferred means bywhich the descriptor specifies the value(s) of the one or moreparameters of the interaction since it reduces the signalling overhead.In this case the host subsystem 93 comprises one or more look-up tables307, e.g. stored in the host memory 306H or another memory to which thehost processor 93H has access (or similarly for the gateway processor93GW). The one or more look-up tables 307 map each of the possiblebehaviour IDs to a different respective one of a plurality ofpredetermined behaviours. The predetermined behaviours are generated inadvance by the compiler, and pre-stored in the host subsystem 93. Eachbehaviour comprises a different set of one or more values for the one ormore parameters to be specified (each set comprising at least one uniquevalue or a unique combination of values). Note this does not have to beachieved in a single look-up table. For instance in the example shown inFIG. 23, the look-up tables 307 comprise two look-up tables. A first ofthe look-up tables 307 maps the behaviour ID to an indication of: thestream ID, and whether streaming is to start or stop. A second of thelook-up tables 307 maps the stream ID to an indication of: the streamdirection (input or output, i.e. incoming or outgoing), and the size ofthe portion of data to be transferred per step (in the particularexample illustrated, in terms of a number of elements per step and asize of each element in bytes, though this is not limiting). Inalternative embodiments it is not excluded that all the specified valuescould be mapped directly to the behaviour ID in a single look-up table307. Other arrangements are also possible.

By whatever means the look-up table(s) 307 is/are implemented, the hostprocessor 93H (or gateway 94GW) uses the behaviour ID signalled in thereceived descriptor to look up the corresponding one or more values ofthe parameter(s) of the interaction in the look-up table(s) 307. Thehost processor 93H (or gateway 93GW) then performs the preparation inthe current step as described previously. In embodiments the descriptormay comprise more than one behaviour ID so as to specify more than oneinteraction in one or both directions.

In variants, the descriptor does not (or not only) specify theinteraction(s) for the next step, but rather one or more further stepss+2, s+3, . . . beyond that. I.e. the descriptor could specify value(s)of one or more parameters of an interaction that is to occur in a steps+k that is k steps ahead of the current step s (where k is a positiveinteger). In some embodiments k is simply always 1 by default, or inalternative embodiments k may be specified by the descriptor (eitherimplicitly or again by means of a look-up mapped to the behaviour ID atthe host side 93). In some cases the descriptor could specifyinteractions for the next K steps, k=1 to K (where K is an upper valueof k); or more generally a range of steps k=k1 . . . k2 (where k1, K2are positive integers and k2>k1); or even an arbitrary set of futuresteps k={ . . . }.

In the case where the parameters include an indication that streaming isto begin in the next step s+1, then the host 93H may assume thatstreaming is to continue (i.e. the interaction will be ongoing) in eachsubsequent step until further notice. E.g. it continues to reserve spacein memory 306H for the same sized portion of the stream at eachsuccessive step s+2, 2+3, etc. “Further notice” means until anotherdescriptor is received from the accelerator subsystem 300 indicatingthat streaming will be terminated in the next step after the sending ofthat descriptor. This means the host 93H can free the reserved memory inthe step after that (two steps from receiving the descriptor indicatingthe termination, i.e. if termination is indicated in step s+j, then thestreaming is terminated in step s+j+1, and the host 93H can free thereserved memory in step s+j+2). The termination may be an additional oneof the behaviours (note therefore that not all behaviours are behavioursthat the host 93H prepares in advance for).

Further example details are described with reference to FIGS. 24 to 26.When the accelerator 2 (e.g. an IPU) runs a program it can read/writedata from external sources. The following describes an example of howthe host processor 93H (and/or any intermediate gateways 93GW) caninteract with this data transfer, and gives an overview of theinteractions between the various actors. It will be exemplified in termsof the host processor 93H but the same teachings may alternatively oradditionally apply to a gateway 93GW.

Regarding streams and IPU directed data movement: when a program runs onthe IPU 2, there are a known, fixed number of data streams that it mayaccess during execution. Each stream is marked as either input or outputand each stream has a fixed element size which is the number of bytestransferred in each step.

A step in this instance is a period of time that the IPU 2 executes forthat has externally visible effect. This is not necessarily the same asthe BSP step of the IPU 2 since some BSP steps have no externallyvisible behaviour. During each step the IPU 2 will read or write to asubset of the streams. This may be called the behaviour of a step.During execution there is a fixed number of behaviours.

On program load, the host 93H can store two meta-information tablesabout the program. An example of the list of streams is given in the toplook-up table 307 in FIG. 23, and an example of the list of behavioursis given in the bottom look-up table in FIG. 23.

An IPU program execution consists of a series of steps. During each stepIPUs will execute one of the communication behaviours. At the end ofeach step the IPU 2 synchronizes with the host 93H to signal that thebehaviour is completed. The host 93H can then act upon thissynchronization.

The IPU 2 is in control of which behaviour it executes. This is totallyunder the remit of the programmer. For example, the IPU 2 could, at eachstep, choose between the possible I/O behaviours in dependence on arandom number generator inside the IPU, an external stimulus, or anon-deterministic calculation.

With regard to the host interaction, at each sync point the host 93Hwill: firstly, act on any stream writes to host memory 306H that havebeen completed in the previous step, and secondly, make sure data isprovided for any stream reads that are going to start in the next step.This process is managed by the host runtime whilst the IPU 2 isexecuting. To complete these actions the host 93H will require to knowwhich behaviour was executed in the previous step and which behaviourwill be executed in the next step.

There are two implementation strategies for this. One is to have thehost 93H “mirror” the control program of the IPU 2 so it knows what iscoming. The second is, at each step, have the IPU 2 transfer its nextstep behaviour to the host. The first option will require extracommunication between the device 2 and the host 93H so the host canmimic the control flow decisions made by the IPU 2. Thereforeembodiments of the present disclosure instead use the second option (thefirst being an optional optimization).

IPU informed behaviours work by the IPU 2 transferring the behaviour IDof the next step to a fixed location in host memory 306H each step. SeeFIG. 24.

This memory location acts as a mailbox. At each sync point, the host 93Hcan perform the following steps:

1. Receive sync request from the device 2

2. Poll on the memory location until it arrives to determine the nextstep behaviour.

3. Act upon data written in the previous step.

4. Prepare read/write buffers 308 for the next step.

5. Clear the behaviour memory location.

6. Release the sync to the device 2.

Note that the IPU 2 starts this process with a behaviour transmissionand sync before any data transfer is performed.

The following now describes an optional technique for optimizing awaysync latency. In a fully synchronous mechanism, then at every step, thedevice 2 syncs with the host 93. However, this synchronization has alarge latency cost. The interaction can be optimized to be performed inan asynchronous manner during the execution of the program. This isenabled by the host sync proxy (HSP) hardware 98. By using thisfunctionality, if the host 93H knows what several behaviours will beahead of time it can eliminate the need for some syncs. The host syncproxy 98 contains a piece of state—the ipu_mark_count (i.e. the numberof credits in the counter 99). This acts as a semaphore. The host 93Hcan increment the mark count and the host sync proxy 98 can decrementit. If the mark count is 0 the IPU 2 cannot progress past a sync step.Each time the IPU 2 goes past a sync step the mark count is decremented.The host and proxy can then interact according to the following set ofasynchronous actions:

Pre-condition Action Host does not know next Host will: behaviour Clearbehaviour memory location Increment ipu_mark_count by 1 Host knows nextK Host will: behaviours Prepare read/write buffers for K steps Incrementipu_mark_count by K Host observes decrease in Host will: ipu_mark_countby J. If ipu_mark_count is 0 and next behaviour is unknown. Read nextbehaviour ID transmitted by IPU. Handle data written to host during theJ steps by IPU. IPU completes step Host sync proxy will: Decrementipu_mark_count. Block IPU until ipu_mark_count is nonzero. Allow IPU tocontinue.

This allows the host 93H to move between asynchronous and synchronousoperation depending on whether it has knowledge of upcoming behavioursor not. See FIG. 25.

How the host 93H knows upcoming behaviours may involve extra informationbeing provided by the compilation process to the host runtime.

Regarding the implementing of a gateway, a gateway 93GW sits between thehost CPU 93H and device 2 during execution and has its own memory 306GW.On the gateway's memory 306GW, local buffers will “mirror” buffers 308on the host CPU 93H. During execution the IPU 2 will read and write tostreams in the gateway local memory 306GW. To act as a proxy betweenhost CPU 93H and device 2 and allow asynchronous operation, the gatewaymay have its own state (the gw_mark_count) and acts between the host CPU93H and gateway 93GW in the same way as between the IPU2 and host CPU93H. The host sync proxy 98 acts between the gateway 93GW and the IPU 2.The gateway can then work as an intermediary by extending the actiontable from the previous section:

Pre-condition Action Host does not know next Host will: behaviour Clearbehaviour memory location Post 1 mark to gateway. Host knows next K Hostwill: behaviours Prepare read/write buffers for K steps Post K marks andK behaviours to gateway. Host observes decrease in Host will:ipu_mark_count by J. If gw_mark_count is 0 and J is 1 and next behaviouris unknown. Read next behaviour ID transmitted by gateway. Handle datawritten to host during the J steps by gateway. Gateway receives K marksGateway will: from host with K future Start transferring buffers fromhost to behaviours gateway for next K steps Increment gw_mark_count byK. Gateway receives mark Gateway will: from host with no known Incrementgw_mark_count by 1. future behaviour. Gateway does not know Gatewaywill: next behaviour and Clear behaviour memory location gw_mark_count >0. Increment ipu_mark_count by 1 Gateway knows K Gateway will:behaviours and Complete copying data from host to gw_mark_count >= n.gateway that will be read in the next K steps. Prepare write buffers fornext K steps. Increment ipu_mark_count by K Gateway observes decreaseGateway will: in ipu_mark_count by J. If ipu_mark_count is 0 and nextbehaviour is unknown. Read next behaviour ID transmitted by IPU.Transmit behaviour ID to host. Copy data written to gateway during the Jsteps by IPU to the host. Decrement gw_mark_count by J. IPU completesstep Host sync proxy will: Decrement ipu_mark_count. Block IPU untilipu_mark_count is nonzero. Allow IPU to continue.

In this scheme, the gateway 93GW can perform asynchronous data transferbetween host CPU 93H and gateway 93GW, and between gateway 93GW and thedevice 2, without requiring knowledge of the control program on the IPU2. It solely needs to act on the future behaviour descriptions given toit by the host CPU 93H. FIG. 26 shows a timeline of the gateway movingfrom synchronous to asynchronous operation.

Between the host CPU 93H and the gateway 93GW an interface may berequired for the following:

Providing the gateway with the stream and behaviour table oninitialization.

Providing information on the mirroring of host buffers and gatewaybuffers for each stream to the gateway.

Allowing the host to increment the gateway mark count, possibly withextra information on known future behaviours.

Querying the gateway on the current value of the gateway mark count.

Note again that in some cases, there may be multiple transfers thathappen in parallel during a single step. For example the system mightsimultaneously transfer data from the device 2 to the host 93 and fromthe host 93 to the device 2. In this case the lookup table indexed bythe behaviour ID contains information about all the transfers (e.g. thedirection of transfer, the size, etc) for that step.

By way of illustration, the following now describes further optionaldetails for implementing the features of the systems of any of FIGS. 21to 26 or similar.

FIG. 1 illustrates an example of a processor module 4 in accordance withembodiments of the present disclosure. For instance the processor module4 may be one tile of an array of like processor tiles on a same chip, ormay be implemented as a stand-alone processor on its own chip. Theprocessor module 4 comprises a multi-threaded processing unit 10 in theform of a barrel-threaded processing unit, and a local memory 11 (i.e.on the same tile in the case of a multi-tile array, or same chip in thecase of a single-processor chip). A barrel-threaded processing unit is atype of multi-threaded processing unit in which the execution time ofthe pipeline is divided into a repeating sequence of interleaved timeslots, each of which can be owned by a given thread. This will bediscussed in more detail shortly. The memory 11 comprises an instructionmemory 12 and a data memory 22 (which may be implemented in differentaddressable memory unit or different regions of the same addressablememory unit). The instruction memory 12 stores machine code to beexecuted by the processing unit 10, whilst the data memory 22 storesboth data to be operated on by the executed code and data output by theexecuted code (e.g. as a result of such operations).

The memory 12 stores a variety of different threads of a program, eachthread comprising a respective sequence of instructions for performing acertain task or tasks. Note that an instruction as referred to hereinmeans a machine code instruction, i.e. an instance of one of thefundamental instructions of the processor's instruction set, consistingof a single opcode and zero or more operands.

The program described herein comprises a plurality of worker threads,and a supervisor subprogram which may be structured as one or moresupervisor threads. These will be discussed in more detail shortly. Inembodiments, each of some or all of the worker threads takes the form ofa respective “codelet”. A codelet is a particular type of thread,sometimes also referred to as an “atomic” thread. It has all the inputinformation it needs to execute from the beginning of the thread (fromthe time of being launched), i.e. it does not take any input from anyother part of the program or from memory after being launched. Further,no other part of the program will use any outputs (results) of thethread until it has terminated (finishes). Unless it encounters anerror, it is guaranteed to finish. N.B. some literature also defines acodelet as being stateless, i.e. if run twice it could not inherit anyinformation from its first run, but that additional definition is notadopted here. Note also that not all of the worker threads need becodelets (atomic), and in embodiments some or all of the workers mayinstead be able to communicate with one another.

Within the processing unit 10, multiple different ones of the threadsfrom the instruction memory 12 can be interleaved through a singleexecution pipeline 13 (though typically only a subset of the totalthreads stored in the instruction memory can be interleaved at any givenpoint in the overall program). The multi-threaded processing unit 10comprises: a plurality of context register files 26 each arranged torepresent the state (context) of a different respective one of thethreads to be executed concurrently; a shared execution pipeline 13 thatis common to the concurrently executed threads; and a scheduler 24 forscheduling the concurrent threads for execution through the sharedpipeline in an interleaved manner, preferably in a round robin manner.The processing unit 10 is connected to a shared instruction memory 12common to the plurality of threads, and a shared data memory 22 that isagain common to the plurality of threads.

The execution pipeline 13 comprises a fetch stage 14, a decode stage 16,and an execution stage 18 comprising an execution unit which may performarithmetic and logical operations, address calculations, load and storeoperations, and other operations, as defined by the instruction setarchitecture. Each of the context register files 26 comprises arespective set of registers for representing the program state of arespective thread.

An example of the registers making up each of the context register files26 is illustrated schematically in FIG. 2. Each of the context registerfiles 26 comprises a respective one or more control registers 28,comprising at least a program counter (PC) for the respective thread(for keeping track of the instruction address at which the thread iscurrently executing), and in embodiments also a set of one or morestatus registers (SR) recording a current status of the respectivethread (such as whether it is currently running or paused, e.g. becauseit has encountered an error). Each of the context register files 26 alsocomprises a respective set of operand registers (OP) 32, for temporarilyholding operands of the instructions executed by the respective thread,i.e. values operated upon or resulting from operations defined by theopcodes of the respective thread's instructions when executed. It willbe appreciated that each of the context register files 26 may optionallycomprise a respective one or more other types of register (not shown).Note also that whilst the term “register file” is sometimes used torefer to a group of registers in a common address space, this does notnecessarily have to be the case in the present disclosure and each ofthe hardware contexts 26 (each of the register sets 26 representing eachcontext) may more generally comprise one or multiple such registerfiles.

In embodiments, the arrangement comprises one worker context registerfile CX0 . . . CX(M−1) for each of the number M of threads that can beexecuted concurrently (M=3 in the example illustrated but this is notlimiting), and one additional supervisor context register file CXS. Theworker context register files are reserved for storing the contexts ofworker threads, and the supervisor context register file is reserved forstoring the context of a supervisor thread. Note that in embodiments thesupervisor context is special, in that it has a different number ofregisters than each of the workers. Each of the worker contextspreferably have the same number of status registers and operandregisters as one another. In embodiments the supervisor context may havefewer operand registers than each of the workers. Examples of operandregisters the worker context may have that the supervisor does notinclude: floating point registers, accumulate registers, and/ordedicated weight registers (for holding weights of a neural network). Inembodiments the supervisor may also have a different number of statusregisters. Further, in embodiments the instruction set architecture ofthe processor module 4 may be configured such that the worker threadsand supervisor thread(s) execute some different types of instruction butalso share some instruction types.

The fetch stage 14 is connected so as to fetch instructions to beexecuted from the instruction memory 12, under control of the scheduler24. The scheduler 24 is configured to control the fetch stage 14 tofetch an instruction from each of a set of concurrently executingthreads in turn in a repeating sequence of time slots, thus dividing theresources of the pipeline 13 into a plurality of temporally interleavedtime slots, as will be discussed in more detail shortly. For example thescheduling scheme could be round-robin or weighted round-robin. Anotherterm for a processor operating in such a manner is a barrel threadedprocessor.

In some embodiments, the scheduler 24 may have access to one of thestatus registers SR of each thread indicating whether the thread ispaused, so that the scheduler 24 in fact controls the fetch stage 14 tofetch the instructions of only those of the threads that are currentlyactive. In embodiments, preferably each time slot (and correspondingcontext register file) is always owned by one thread or another, i.e.each slot is always occupied by some thread, and each slot is alwaysincluded in the sequence of the scheduler 24; though the threadoccupying any given slot may happen to be paused at the time, in whichcase when the sequence comes around to that slot, the instruction fetchfor the respective thread is passed over. Alternatively it is notexcluded for example that in alternative, less preferredimplementations, some slots can be temporarily vacant and excluded fromthe scheduled sequence. Where reference is made to the number of timeslots the execution unit is operable to interleave, or such like, thisrefers to the maximum number of slots the execution unit is capable ofexecuting concurrently, i.e. the number of concurrent slots theexecution unit's hardware supports.

The fetch stage 14 has access to the program counter (PC) of each of thecontexts. For each respective thread, the fetch stage 14 fetches thenext instruction of that thread from the next address in the programmemory 12 as indicated by the program counter. The program counterincrements each execution cycle unless branched by a branch instruction.The fetch stage 14 then passes the fetched instruction to the decodestage 16 to be decoded, and the decode stage 16 then passes anindication of the decoded instruction to the execution unit 18 alongwith the decoded addresses of any operand registers 32 specified in theinstruction, in order for the instruction to be executed. The executionunit 18 has access to the operand registers 32 and the control registers28, which it may use in executing the instruction based on the decodedregister addresses, such as in the case of an arithmetic instruction(e.g. by adding, multiplying, subtracting or dividing the values in twooperand registers and outputting the result to another operand registerof the respective thread). Or if the instruction defines a memory access(load or store), the load/store logic of the execution unit 18 loads avalue from the data memory into an operand register of the respectivethread, or stores a value from an operand register of the respectivethread into the data memory 22, in accordance with the instruction. Orif the instruction defines a branch or a status change, the executionunit changes value in the program counter PC or one of the statusregisters SR accordingly. Note that while one thread's instruction isbeing executed by the execution unit 18, an instruction from the threadin the next time slot in the interleaved sequence can be being decodedby the decode stage 16; and/or while one instruction is being decoded bythe decode stage 16, the instruction from the thread in the next timeslot after that can be being fetched by the fetch stage 14 (though ingeneral the scope of the disclosure is not limited to one instructionper time slot, e.g. in alternative scenarios a batch of two or moreinstructions could be issued from a given thread per time slot). Thusthe interleaving advantageously hides latency in the pipeline 13, inaccordance with known barrel threaded processing techniques.

An example of the interleaving scheme implemented by the scheduler 24 isillustrated in FIG. 3. Here the concurrent threads are interleavedaccording to a round-robin scheme whereby, within each round of thescheme, the round is divided into a sequence of time slots S0, S1, S2 .. . , each for executing a respective thread. Typically each slot is oneprocessor cycle long and the different slots are evenly sized, thoughnot necessarily so in all possible embodiments, e.g. a weightedround-robin scheme is also possible whereby some threads get more cyclesthan others per execution round. In general the barrel-threading mayemploy either an even round-robin or a weighted round-robin schedule,where in the latter case the weighting may be fixed or adaptive.

Whatever the sequence per execution round, this pattern then repeats,each round comprising a respective instance of each of the time slots.Note therefore that a time slot as referred to herein means therepeating allocated place in the sequence, not a particular instance ofthe time slot in a given repetition of the sequence. Put another way,the scheduler 24 apportions the execution cycles of the pipeline 13 intoa plurality of temporally interleaved (time-division multiplexed)execution channels, with each comprising a recurrence of a respectivetime slot in a repeating sequence of time slots. In the illustratedembodiment, there are four time slots, but this is just for illustrativepurposes and other numbers are possible. E.g. in one preferredembodiment there are in fact six time slots.

Whatever the number of time slots the round-robin scheme is dividedinto, then according to present disclosure, the processing unit 10comprises one more context register file 26 than there are time slots,i.e. it supports one more context than the number of interleavedtimeslots it is capable of barrel-threading.

This is illustrated by way of example in FIG. 2: if there are four timeslots S0 . . . S3 as shown in FIG. 3, then there are five contextregister files, labelled here CX0, CX1, CX2, CX3 and CXS. That is, eventhough there are only four execution time slots S0 . . . S3 in thebarrel-threaded scheme and so only four threads can be executedconcurrently, it is disclosed herein to add a fifth context registerfile CXS, comprising a fifth program counter (PC), a fifth set ofoperand registers 32, and in embodiments also a fifth set of one or morestatus registers (SR). Though note that as mentioned, in embodiments thesupervisor context may differ from the others CX0 . . . 3, and thesupervisor thread may support a different set of instructions foroperating the execution pipeline 13.

Each of the first four contexts CX0 . . . CX3 is used to represent thestate of a respective one of a plurality of “worker threads” currentlyassigned to one of the four execution time slots S0 . . . S3, forperforming whatever application-specific computation tasks are desiredby the programmer (note again this may only be subset of the totalnumber of worker threads of the program as stored in the instructionmemory 12). The fifth context CXS however, is reserved for a specialfunction, to represent the state of a “supervisor thread” (SV) whoserole it is to coordinate the execution of the worker threads, at leastin the sense of assigning which of the worker threads W is to beexecuted in which of the time slots S0, S1, S2 . . . at what point inthe overall program. Optionally the supervisor thread may have other“overseer” or coordinating responsibilities. For example, the supervisorthread may be responsible for performing barrier synchronisations toensure a certain order of execution. E.g. in a case where one or moresecond threads are dependent on data to be output by one or more firstthreads run on the same processor module 4, the supervisor may perform abarrier synchronization to ensure that none of the second threads beginsuntil the first threads have finished. And/or, the supervisor mayperform a barrier synchronization to ensure that one or more threads onthe processor module 4 do not begin until a certain external source ofdata, such as another tile or processor chip, has completed theprocessing required to make that data available. The supervisor threadmay also be used to perform other functionality relating to the multipleworker threads. For example, the supervisor thread may be responsiblefor communicating data externally to the processor module 4 (to receiveexternal data to be acted on by one or more of the threads, and/or totransmit data output by one or more of the worker threads). In generalthe supervisor thread may be used to provide any kind of overseeing orcoordinating function desired by the programmer. For instance as anotherexample, the supervisor may oversee transfer between the tile localmemory 12 and one or more resources in the wider system (external to thearray 6) such as a storage disk or network card.

Note of course that four time slots is just an example, and generally inother embodiments there may be other numbers, such that if there are amaximum of M time slots 0 . . . M−1 per round, the processor module 4comprises M+1 contexts CX . . . CX(M−1) & CXS, i.e. one for each workerthread that can be interleaved at any given time and an extra contextfor the supervisor. E.g. in one exemplary implementation there are sixtimeslots and seven contexts.

Referring to FIG. 4, the supervisor thread SV does not have its own timeslot per se in the scheme of interleaved time slots. Nor do the workersas allocation of slots to worker threads is flexibly defined. Rather,each time slot has its own dedicated context register file (CX0 . . .CXM−1) for storing worker context, which is used by the worker when theslot is allocated to the worker, but not used when the slot is allocatedto the supervisor. When a given slot is allocated to the supervisor,that slot instead uses the context register file CXS of the supervisor.Note that the supervisor always has access to its own context and noworkers are able to occupy the supervisor context register file CXS.

The supervisor thread SV has the ability to run in any and all of thetime slots S0 . . . S3 (or more generally S0 . . . SM−1). The scheduler24 is configured so as, when the program as a whole starts, to begin byallocating the supervisor thread to all of the time slots, i.e. so thesupervisor SV starts out running in all of S0 . . . S3. However, thesupervisor thread is provided with a mechanism for, at some subsequentpoint (either straight away or after performing one or more supervisortasks), temporarily relinquishing each of the slots in which it isrunning to a respective one of the worker threads, e.g. initiallyworkers W0 . . . W3 in the example shown in FIG. 4. This is achieved bythe supervisor thread executing a run instruction, called “RUN” by wayof example herein. In embodiments this instruction takes two operands:an address of a worker thread in the instruction memory 12 and anaddress of some data for that worker thread in the data memory 22:

RUN task_addr, data_addr

The worker threads are portions of code that can be run concurrentlywith one another, each representing one or more respective computationtasks to be performed. The data address may specify some data to beacted upon by the worker thread. Alternatively, the run instruction maytake only a single operand specifying the address of the worker thread,and the data address could be included in the code of the worker thread;or in another example the single operand could point to a data structurespecifying the addresses of the worker thread and data. As mentioned, inembodiments at least some of the workers may take the form of codelets,i.e. atomic units of concurrently executable code. Alternatively oradditionally, some of the workers need not be codelets and may insteadbe able to communicate with one another.

The run instruction (“RUN”) acts on the scheduler 24 so as to relinquishthe current time slot, in which this instruction is itself executed, tothe worker thread specified by the operand. Note that it is implicit inthe run instruction that it is the time slot in which this instructionis executed that is being relinquished (implicit in the context ofmachine code instructions means it doesn't need an operand to specifythis—it is understood implicitly from the opcode itself). Thus the timeslot which is given away is the time slot in which the supervisorexecutes the run instruction. Or put another way, the supervisor isexecuting in the same space that that it gives away. The supervisor says“run this piece of code at this location”, and then from that pointonwards the recurring slot is owned (temporarily) by the relevant workerthread.

The supervisor thread SV performs a similar operation in each of one ormore others of the time slots, to give away some or all of its timeslots to different respective ones of the worker threads W0 . . . W3(selected from a larger set W0 . . . Wj in the instruction memory 12).Once it has done so for the last slot, the supervisor is suspended (thenlater will resume where it left off when one of the slots is handed backby a worker W).

The supervisor thread SV is thus able to allocate different workerthreads, each performing one or more tasks, to different ones of theinterleaved execution time slots S0 . . . S3. When the supervisor threaddetermines it is time to run a worker thread, it uses the runinstruction (“RUN”) to allocate this worker to the time slot in whichthe RUN instruction was executed.

In some embodiments, the instruction set also comprises a variant of therun instruction, RUNALL (“run all”). This instruction is used to launcha set of more than one worker together, all executing the same code. Inembodiments this launches a worker in every one of the processing unit'sslots S0 . . . S3 (or more generally S0 . . . S(M−1)).

Further, in some embodiments the RUN and/or RUNALL instruction, whenexecuted, also automatically copies some status from one or more of thesupervisor status registers CXS(SR) to a corresponding one or morestatus registers of the worker thread(s) launched by the RUN or RUNALL.For instance the copied status may comprise one or more modes, such as afloating point rounding mode (e.g. round to nearest or round to zero)and/or an overflow mode (e.g. saturate or use a separate valuerepresenting infinity). The copied status or mode then controls theworker in question to operate in accordance with the copied status ormode. In embodiments, the worker can later overwrite this in its ownstatus register (but cannot change the supervisor's status). In furtheralternative or additional embodiments, the workers can choose to readsome status from one or more status registers of the supervisor (andagain may change their own status later). E.g. again this could be toadopt a mode from the supervisor status register, such as a floatingpoint mode or a rounding mode. In embodiments however, the supervisorcannot read any of the context registers CX0 . . . of the workers.

Each of the currently allocated worker threads W0 . . . W3 proceeds toperform the one or more computation tasks defined in the code specifiedby the respective run instruction. At the end of this, the respectiveworker thread then hands the time slot in which it is running back tothe supervisor thread. This is achieved by executing an exit instruction(“EXIT”).

The EXIT instruction takes at least one operand and preferably only asingle operand, exit_state (e.g. a binary value), to be used for anypurpose desired by the programmer to indicate a state of the respectivecodelet upon ending (e.g. to indicate whether a certain condition wasmet):

EXIT exit_state

The EXIT instruction acts on the scheduler 24 so that the time slot inwhich it is executed is returned back to the supervisor thread. Thesupervisor thread can then perform one or more subsequent supervisortasks (e.g. barrier synchronization and/or exchange of data withexternal resources such as other tiles), and/or continue to executeanother run instruction to allocate a new worker thread (W4, etc.) tothe slot in question. Note again therefore that the total number ofthreads in the instruction memory 12 may be greater than the number thatbarrel-threaded processing unit 10 can interleave at any one time. It isthe role of the supervisor thread SV to schedule which of the workerthreads W0 . . . Wj from the instruction memory 12, at which stage inthe overall program, are to be assigned to which of the interleaved timeslots S0 . . . SM in the round robin schedule of the scheduler 24.

Furthermore, in embodiments the EXIT instruction may have a furtherspecial function, namely to cause the exit state specified in theoperand of the EXIT instruction to be automatically aggregated (bydedicated hardware logic 37) with the exit states of a plurality ofother worker threads being run through the same pipeline 13 of the sameprocessor module 4 (e.g. same tile). Thus an extra, implicit facility isincluded in the instruction for terminating a worker thread.

An example circuit for achieving this is shown in FIG. 5. In thisexample, the exit states of the individual threads and the aggregatedexit state each take the form of a single bit, i.e. 0 or 1. Theprocessor module 4 comprises a “local consensus” ($LC) register 38 forstoring the aggregated exit state of that processor module 4. Inembodiments this local consensus register $LC 38 is one of thesupervisor's status registers in the supervisor's context register fileCXS. The logic for performing the aggregation may comprise an AND gate37 arranged to perform a logical AND of (A) the exit state specified inthe EXIT instructions' operand and (B) the current value in the localconsensus register ($LC) 38, and to output the result (Q) back into thelocal consensus register $LC 38 as a new value of the local aggregate.However it will be appreciated that FIG. 5 is just one example and otherforms of automated aggregation could be implemented, such as a BooleanOR (equivalent if the interpretation of 0 and 1 are inverted), or morecomplex circuitry for aggregating non-Booleans exit states. E.g. inembodiments the exit states may be trinary states.

At a suitable synchronization point in the program, the value stored inthe local consensus register ($LC) 38 is initially reset to a valueof 1. I.e. any threads exiting after this point will contribute to thelocally aggregated exit state $LC until next reset. Every time an EXITinstruction is executed its exit state is aggregated with those thathave gone before (since last reset). Thus by means of the arrangementshown in FIG. 5, the logic keeps a running aggregate of the exit statesof any worker threads which have terminated by means of an EXITinstruction since the last time the local consensus register ($LC) 38was reset. The reset of the aggregate in the local consensus register($LC) 38 may be performed by the supervisor SV performing a PUT to theregister address of the local consensus register ($LC) 38 using one ormore general purpose instructions. Alternatively it is not excluded thatthe reset could be performed by an automated mechanism, for exampletriggered by executing the SYNC instruction described later herein.

The exit states can be used to represent whatever the programmer wishes,but one particularly envisaged example is to use an exit state of 1 toindicate that the respective worker thread has exited in a “successful”or “true” state, whilst an exit state of 0 indicates the respectiveworker thread exited in an “unsuccessful” or “false” state. E.g. theexit state of a thread may represent whether the error(s) in the one ormore parameters of a respective node in the graph of a machineintelligence algorithm has/have fallen within an acceptable levelaccording to a predetermined metric; or in a non-Boolean case, a degreeof confidence in the result of the thread.

Whatever meaning is given by the programmer to the exit states, thesupervisor thread SV can then get the aggregated value from the localconsensus register ($LC) 38 to determine the aggregated exit state ofall the worker threads that exited since it was last reset, for exampleat the last synchronization point, e.g. to determine whether or not allthe workers exited in a successful or true state. In dependence on thisaggregated value, the supervisor thread may then make a decision inaccordance with the programmer's design; such as to report to the hostprocessor 93H, or perform another iteration of the part of the programcomprising the same worker threads.

Referring to FIG. 6, in embodiments a SYNC (synchronization) instructionis provided in the processor's instruction set. The SYNC instruction hasthe effect of causing the supervisor thread SV to wait until allcurrently executing workers W have exited by means of an EXITinstruction. In embodiments the SYNC instruction takes a mode as anoperand (in embodiments its only operand), the mode specifying whetherthe SYNC is to act only locally in relation to only those worker threadsrunning locally on the same processor module 4, e.g. same tile, as thesupervisor as part of which the SYNC is executed on (i.e. only threadsthrough the same pipeline 13 of the same barrel-threaded processing unit10); or whether instead it is to apply across multiple tiles or evenacross multiple chips.

SYNC mode // mode∈{tile, chip, zone_1, zone_2}

This will be discussed in more detail later but for the purposes of FIG.6 a local SYNC will be assumed (“SYNC tile”, i.e. a synchronizationwithin a single tile).

The workers do not need to be identified as operands of the SYNCinstruction, as it is implicit that the supervisor SV is then caused toautomatically wait until none of the time slots S0, S1, . . . of thebarrel-threaded processing unit 10 is occupied by a worker. As shown inFIG. 6, once each of a current batch of workers WLn have all beenlaunched by the supervisor, the supervisor then executes a SYNCinstruction. If the supervisor SV launches workers W in all the slots S0. . . 3 of the barrel-threaded processing unit 10 (all four in theexample illustrated, but that is just one example implementation), thenthe SYNC will be executed by the supervisor once the first of thecurrent batch of worker threads WLn has exited, thus handing backcontrol of at least one slot to the supervisor SV. Otherwise if theworkers do not take up all of the slots, the SYNC will simply beexecuted immediately after the last thread of the current batch WLn hasbeen launched. Either way, the SYNC causes the supervisor SV to wait forall others of the current batch of workers WLn−1 to execute an EXITbefore the supervisor can proceed. Only after this the supervisorexecutes a GET instruction to get the content of the local consensusregister ($LC) 38. This waiting by the supervisor thread is imposed inhardware once the SYNC has been executed. I.e. in response to the opcodeof the SYNC instruction, the logic in the execution unit (EXU) of theexecution stage 18 causes the fetch stage 14 and scheduler 24 to pausefrom issuing instructions of the supervisor thread until all outstandingworker threads have executed an EXIT instruction. At some point aftergetting the value of the local consensus register ($LC) 38 (optionallywith some other supervisor code in between), the supervisor executes aPUT instruction to reset the local consensus register ($LC) 38 (in theillustrated example to 1).

As also illustrated in FIG. 6, the SYNC instruction may also be used toplace synchronization barriers between different interdependent layersWL1, WL2, WL3, . . . of worker threads, where one or more threads ineach successive layer is dependent on data output by one or more workerthreads in its preceding layer. The local SYNC executed by thesupervisor thread ensures that none of the worker threads in the nextlayer WLn+1 executes until all the worker threads in the immediatelypreceding layer WLn have exited (by executing an EXIT instruction).

As mentioned, in embodiments the processor module 4 may be implementedas one of an array of interconnected tiles forming a multi-tileprocessor, wherein each of tile may be configured as described above inrelation to FIGS. 1 to 6.

This is illustrated further in FIG. 7 which shows a single chipprocessor 2, i.e. a single die, comprising an array 6 of multipleprocessor tiles 4 and an on-chip interconnect 34 connecting between thetiles 4. The chip 2 may be implemented alone on its own single-chipintegrated circuit package, or as one of multiple dies packaged in thesame IC package. The on-chip interconnect may also be referred to hereinas the “exchange fabric” 34 as it enables the tiles 4 to exchange datawith one another. Each tile 4 comprises a respective instance of thebarrel-threaded processing unit 10 and memory 11, each arranged asdescribed above in relation to FIGS. 1 to 6. For instance, by way ofillustration the chip 2 may comprise of the order of hundreds of tiles4, or even over a thousand. For completeness, note also that an “array”as referred to herein does not necessarily imply any particular numberof dimensions or physical layout of the tiles 4.

In embodiments each chip 2 also comprises one or more external links 8,enabling the chip-2 to be connected to one or more other, externalprocessors on different chips (e.g. one or more other instances of thesame chip 2). These external links 8 may comprise any one or more of:one or more chip-to-host links for connecting the chip 2 to a hostprocessor, and/or one or more chip-to-chip links for connecting togetherwith one or more other instances of the chip 2 on the same IC package orcard, or on different cards. In one example arrangement, the chip 2receives work from a host processor (not shown) which is connected tothe chip via one of the chip-to-host links in the form of input data tobe processed by the chip 2. Multiple instances of the chip 2 can beconnected together into cards by chip-to-chip links. Thus a host mayaccess a computer which is architected as a single chip processor 2 oras multiple single chip processors 2 possibly arranged on multipleinterconnected cards, depending on the workload required for the hostapplication.

The interconnect 34 is configured to enable the different processortiles 4 in the array 6 to communicate with one another on-chip 2.However, as well as there potentially being dependencies between threadson the same tile 4, there may also be dependencies between the portionsof the program running on different tiles 4 in the array 6. A techniqueis therefore required to prevent a piece of code on one tile 4 runningahead of data upon which it is dependent being made available by anotherpiece of code on another tile 4.

This may be achieved by implementing a bulk synchronous parallel (BSP)exchange scheme, as illustrated schematically in FIGS. 8 and 9.

According to one version of BSP, each tile 4 performs a compute phase 52and an exchange phase 50 in an alternating cycle, separated from one tothe other by a barrier synchronization 30 between tiles. In the caseillustrated a barrier synchronization is placed between each computephase 52 and the following exchange phase 50. During the compute phase52 each tile 4 performs one or more computation tasks locally on-tile,but does not communicate any results of these computations with anyothers of the tiles 4. In the exchange phase 50 each tile 4 is allowedto exchange one or more results of the computations from the precedingcompute phase to and/or from one or more others of the tiles in thegroup, but does not perform any new computations until it has receivedfrom other tiles 4 any data on which its task(s) has/have dependency.Neither does it send to any other tile any data except that computed inthe preceding compute phase. It is not excluded that other operationssuch as internal control-related operations may be performed in theexchange phase. In embodiments the exchange phase 50 does not includeany non-time-deterministic computations, but a small number oftime-deterministic computations may optionally be allowed during theexchange phase 50. Note also that a tile 4 performing computation may beallowed during the compute phase 52 to communicate with other externalsystem resources external to the array of tiles 4 beingsynchronized—e.g. a network card, disk drive, or field programmable gatearray (FPGA)—as long as this does not involve communication with othertiles 4 within the group being synchronized. The communication externalto the tile group may optionally utilise the BSP mechanism, butalternatively may not utilize BSP and may instead use some othersynchronization mechanism of its own.

According to the BSP principle, a barrier synchronization 30 is placedat the juncture transitioning from the compute phases 52 into theexchange phase 50, or the juncture transitioning from the exchangephases 50 into the compute phase 52, or both. That is to say, either:(a) all tiles 4 are required to complete their respective compute phases52 before any in the group is allowed to proceed to the next exchangephase 50, or (b) all tiles 4 in the group are required to complete theirrespective exchange phases 50 before any tile in the group is allowed toproceed to the next compute phase 52, or (c) both of these conditions isenforced. In all three variants it is the individual processors whichalternate between phases, and the whole assembly which synchronizes. Thesequence of exchange and compute phases may then repeat over multiplerepetitions. In BSP terminology, each repetition of exchange phase andcompute phase is sometimes referred to as a “superstep” (though notethat in the literature the terminology is not always used consistently:sometimes each individual exchange phase and compute phase individuallyis called a superstep, whereas elsewhere, as in the terminology adoptedherein, the exchange and compute phases together are referred to as asuperstep).

Note also, it is not excluded that multiple different independent groupsof tiles 4 on the same chip 2 or different chips could each form aseparate respective BSP group operating asynchronously with respect toone another, with the BSP cycle of compute, synchronize and exchangebeing imposed only within each given group, but each group doing soindependently of the other groups. I.e. a multi-tile array 6 mightinclude multiple internally synchronous groups each operatingindependently and asynchronously to the other such groups (discussed inmore detail later). In some embodiments there is a hierarchical groupingof sync and exchange, as will be discussed in more detail later.

FIG. 9 illustrates the BSP principle as implemented amongst a group 4 i,4 ii, 4 iii of some or all of the tiles in the array 6, in the casewhich imposes: (a) a barrier synchronization from compute phase 52 toexchange phase 50 (see above). Note that in this arrangement, some tiles4 are allowed to begin computing 52 whilst some others are stillexchanging.

According to embodiments disclosed herein, this type of BSP may befacilitated by incorporating additional, special, dedicatedfunctionality into a machine code instruction for performing barriersynchronization, i.e. the SYNC instruction.

In embodiments, the SYNC function takes this functionality whenqualified by an inter-tile mode as an operand, e.g. the on-chip mode:SYNC chip.

This is illustrated schematically in FIG. 10. In the case where eachtile 4 comprises a multi-threaded processing unit 10, then each tile'scompute phase 52 may in fact comprise tasks performed by multiple workerthreads W on the same tile 4 (and a given compute phase 52 on a giventile 4 may comprise one or more layers WL of worker threads, which inthe case of multiple layers may be separated by internal barriersynchronizations using the SYNC instruction with the local on-tile modeas an operand, as described previously). Once the supervisor thread SVon a given tile 4 has launched the last worker thread in the current BSPsuperstep, the supervisor on that tile 4 then executes a SYNCinstruction with the inter-tile mode set as the operand: SYNC chip. Ifthe supervisor is to launch (RUN) worker threads in all the slots of itsrespective processing unit 10, the “SYNC chip” is executed as soon asthe first slot that is no longer needed to RUN any more workers in thecurrent BSP superstep is handed back to the supervisor. E.g. this mayoccur after the first thread to EXIT in the last layer WL, or simplyafter the first worker thread to EXIT if there is only a single layer.Otherwise if not all the slots are to be used for running workers in thecurrent BSP superstep, the “SYNC chip” can be executed as soon as thelast worker that needs to be RUN in the current BSP superstep has beenlaunched. This may occur once all the workers in the last layer havebeen RUN, or simply once all the worker threads have been RUN if thereis only one layer.

The execution unit (EXU) of the execution stage 18 is configured so as,in response to the opcode of the SYNC instruction, when qualified by theon-chip (inter-tile) operand, to cause the supervisor thread in whichthe “SYNC chip” was executed to be paused until all the tiles 4 in thearray 6 have finished running workers. This can be used to implement abarrier to the next BSP superstep. I.e. after all tiles 4 on the chip 2have passed the barrier, the cross-tile program as a whole can progressto the next exchange phase 50.

FIG. 11 gives a schematic diagram illustrating the logic trigged by a“SYNC chip” according to embodiments disclosed herein.

Once the supervisor has launched (RUN) all of the threads it intends toin the current compute phase 52, it then executes a SYNC instructionwith the on-chip, inter-tile operand: SYNC chip. This triggers thefollowing functionality to be triggered in dedicated synchronizationlogic 39 on the tile 4, and in a synchronization controller 36implemented in the hardware interconnect 34. This functionality of boththe on-tile sync logic 39 and the synchronization controller 36 in theinterconnect 34 is implemented in dedicated hardware circuitry suchthat, once the SYNC chip is executed, the rest of the functionalityproceeds without further instructions being executed to do so.

Firstly, the on-tile sync logic 39 causes the instruction issue for thesupervisor on the tile 4 in question to automatically pause (causes thefetch stage 14 and scheduler 24 to suspend issuing instructions of thesupervisor). Once all the outstanding worker threads on the local tile 4have performed an EXIT, then the sync logic 39 automatically sends asynchronization request “sync_req” to the synchronization controller 36in the interconnect 34. The local tile 4 then continues to wait with thesupervisor instruction issue paused. A similar process is alsoimplemented on each of the other tiles 4 in the array 6 (each comprisingits own instance of the sync logic 39). Thus at some point, once all thefinal workers in the current compute phase 52 have EXITed on all thetiles 4 in the array 6, the synchronization controller 36 will havereceived a respective synchronization request (sync_req) from all thetiles 4 in the array 6. Only then, in response to receiving the sync_reqfrom every tile 4 in the array 6 on the same chip 2, the synchronizationcontroller 36 sends a synchronization acknowledgement signal “sync_ack”back to the sync logic 39 on each of the tiles 4. Up until this point,each of the tiles 4 has had its supervisor instruction issue pausedwaiting for the synchronization acknowledgment signal (sync_ack). Uponreceiving the sync_ack signal, the sync logic 39 in the tile 4automatically unpauses the supervisor instruction issue for therespective supervisor thread on that tile 4. The supervisor is then freeto proceed with exchanging data with other tiles 4 via the interconnect34 in a subsequent exchange phase 50.

Preferably the sync_req and sync_ack signals are transmitted andreceived to and from the synchronization controller, respectively, viaone or more dedicated sync wires connecting each tile 4 to thesynchronization controller 36 in the interconnect 34.

Furthermore, in embodiments, an additional functionality may be includedin the SYNC instruction. That is, at least when executed in aninter-tile mode (e.g. SYNC chip), the SYNC instruction also causes thelocal exit states $LC of each of the synchronized tiles 4 to beautomatically aggregated by further dedicated hardware 40 in theinterconnect 34. In the embodiment shown this logic 40 takes the AND ofthe local exits states. However, this is just one example, and in otherembodiments the global aggregation logic 40 could e.g. take the BooleanOR, or a more complex combination of non-Boolean exit states.

In response to the synchronization request (sync_req) being receivedfrom all of the tiles 4 in the array 6, the synchronization controller36 causes the output of the global aggregation logic 40 to be stored ina global consensus register ($GC) 42 on each tile 4. This register $GC42 is accessible by the supervisor thread SV on the respective tile 4once the supervisor instruction issue is resumed. In embodiments theglobal consensus register $GC is implemented as a control register inthe supervisor's control register file CXS, 28 such that the supervisorthread can get the value in the global consensus register ($GC) 42 bymeans of a GET instruction.

The globally aggregated exit state $GC enables the program to determinean overall outcome of parts of the program running on multiple differenttiles 4 without having to individually examine the state of eachindividual worker thread on each individual tile. It can be used for anypurpose desired by the programmer, e.g. to determine whether or not theparts of the code running on all the tiles have all satisfied apredetermined condition, or an overall degree of confidence in theresults of the tiles. In one example use case, the supervisor on one ormore of the tiles may report to the host processor 93H if the globalaggregate indicated a false or unsuccessful outcome. As another example,the program may perform a branch decision depending on the global exitstate.

As mentioned previously, in embodiments multiple instances of the chip 2can be connected together to form an even larger array of tiles 4spanning multiple chips 2. This is illustrated in FIG. 12. Some or allof the chips 2 may be implemented on the same IC package or some or allof the chips 2 may be implemented on different IC packages. The chips 2are connected together by an external interconnect 72 (via the externallinks 8 shown in FIG. 7). This may connect between chips 2 on the sameIC package, different IC packages on the same card, and/or different ICpackages on different cards. As well as providing a conduit for exchangeof data between tiles 4 on different chips, the external interconnect 72also provides hardware support for performing barrier synchronizationbetween the tiles 4 on different chips 2 and aggregating the local exitstates of the tiles 4 on the different chips 2.

In embodiments, the SYNC instruction can take at least one furtherpossible value of its mode operand to specify an external, i.e.inter-chip, synchronization: SYNC zone_n, wherein zone_n represents anexternal sync zone. The external interconnect 72 comprises similarhardware logic to that described in relation to FIG. 11, but on anexternal, inter-chip scale. When the SYNC instruction is executed withan external sync zone of two or more chips 2 specified in its operand,this causes the logic in the external interconnect 72 to operate in asimilar manner to that described in relation to the internalinterconnect 34, but across the tiles 4 on the multiple different chips2 in the specified sync zone.

That is, in response to the opcode of the SYNC instruction whose operandspecifies an external sync, the execution stage 18 causes the sync levelspecified by the operand to be signalled to dedicated hardware synclogic 76 in the external interconnect 72. In response to this, the synclogic 76 in the external interconnect conducts the process ofsynchronisation request (sync_req) and acknowledgment (sync_ack) to beperformed only amongst all the external tiles 4 to which, e.g. all thetiles across all chips 2 in the system for a global sync. I.e. the synclogic 76 in the external interconnect 72 will return the syncacknowledgment signal (sync_ack) to the tiles 4 across chips 2 only oncea synchronization request (sync_req) has been received from all thetiles 4 from those chips. All the tiles 4 on all those chips 2 will beautomatically paused until the sync acknowledgment (sync_ack) from theexternal sync logic 76 is returned.

Thus, in response to an external SYNC, the supervisor instruction issueis paused until all tiles 4 on all chips 2 in the external sync zonehave completed their compute phase 52 and submitted a sync request.Further, logic in the external interconnect 72 aggregates the local exitstates of all these tiles 4, across the multiple chips 2 in the zone inquestion. Once all tiles 4 in the external sync zone have made the syncrequest, the external interconnect 72 signals a sync acknowledgment backto the tiles 4 and stores the cross-chip global aggregate exit stateinto the global consensus registers ($GC) 42 of all the tiles 4 inquestion. In response to the sync acknowledgement, the tiles 4 on allthe chips 2 in the zone resume instruction issue for the supervisor.

Note that in embodiments the functionality of the interconnect 72 may beimplemented in the chips 2, i.e. the logic may be distributed among thechips 2 such that only wired connections between chips are required(FIGS. 11 and 12 are schematic).

All tiles 4 within the mentioned sync zone are programmed to indicatethe same sync zone via the mode operand of their respective SYNCinstructions. In embodiments the sync logic 76 in the externalinterconnect 72 peripheral is configured such that, if this is not thecase due to a programming error or other error (such as a memory parityerror), then some or all tiles 4 will not receive an acknowledgement,and therefore that the system will come to a halt at the next externalbarrier, thus allowing a managing external CPU (e.g. the host) tointervene for debug or system recovery. Preferably however the compileris configured to ensure the tiles in the same zone all indicate thesame, correct sync zone at the relevant time. The sync logic may also beconfigured to take other alternative or additional measures in event ofinconsistency in the modes indicated by the different SYNC instruction,e.g. raising an exception to the external CPU, and/or halting executionby some other mechanism.

As illustrated in FIG. 14, in embodiments the mode of the SYNCinstruction can be used to specify one of multiple different possibleexternal sync zones, e.g. zone_1 or zone_2. In embodiments thesecorrespond to different hierarchical levels. That is to say, each higherhierarchical level 92 (e.g. zone 2) encompasses two or more zones 91A,91B of at least one lower hierarchical level. In embodiments there arejust two hierarchical levels, but higher numbers of nested levels arenot excluded. If the operand of the SYNC instruction is set to the lowerhierarchical level of external sync zone (SYNC zone_1), then theabove-described sync and aggregation operations are performed inrelation to the tiles 4 on the chips 2 in only the same lower-levelexternal sync zone as the tile on which the SYNC was executed. If on theother hand the operand of the SYNC instruction is set to the higherhierarchical level of external sync zone (SYNC zone_2), then theabove-described sync and aggregation operations are automaticallyperformed in relation to all the tiles 4 on all the chips 2 in the samehigher-level external sync zone as the tile on which the SYNC wasexecuted.

In response to the opcode of the SYNC instruction having an externalsync zone as an operand, the execution stage 18 causes the sync levelspecified by the operand to be signalled to dedicated hardware synclogic 76 in the external interconnect 72. In response to this, the synclogic 76 in the external interconnect conducts the process ofsynchronisation request (sync_req) and acknowledgment (sync_ack) to beperformed only amongst the tiles 4 of the signalled group. I.e. the synclogic 76 in the external interconnect 72 will return the syncacknowledgment signal (sync_ack) to the tiles in the signalled sync zoneonly once a synchronization request (sync_req) has been received fromall the tiles 4 in that zone (but will not wait for any other tilesoutside that zone if it is not a global sync).

Note that in other embodiments, the sync zones that can be specified bythe mode of the SYNC instruction are not limited to being hierarchicalin nature. In general, a SYNC instruction may be provided with modescorresponding to any kind of grouping. For instance, the modes mayenable selection from amongst only non-hierarchical groups, or a mixtureof hierarchical groupings and one or more non-hierarchical groups (whereat least one group is not entirely nested within another). Thisadvantageously enables the flexibility for the programmer or compiler,with minimal code density, to select between different layouts ofinternally-synchronous groups that are asynchronous with respect to oneanother.

An example mechanism for implementing the synchronization amongst theselected sync group 91, 92 is illustrated in FIG. 18. As illustrated,the external sync logic 76 in the external interconnect 72 comprises arespective sync block 95 associated with each respective chip 2. Eachsync block 95 comprises respective gating logic and a respective syncaggregator. The gating logic comprises hardware circuitry which connectstogether the chips 2 in a daisy chain topology for the purpose ofsynchronization and exit state aggregation, and which propagates thesync and exit state information in accordance with the following. Thesync aggregator comprises hardware circuitry configured to aggregate thesynchronization requests (sync_req) and the exit states in accordancewith the following.

The respective sync block 95 associated with each chip 2 is connected toits respective chip 2, such that it can detect the sync request(Sync_req) raised by that chip 2 and the exit state of that chip 2, andso that it can return the sync acknowledgment (Sync_ack) and global exitstate to the respective chip 2. The respective sync block 95 associatedwith each chip 2 is also connected to the sync block 95 of at least oneother of the chips 2 via a sync interface comprising one or more syncwires 96 (part of the sync network). Some of the chips' sync blocks 95are connected to that of two adjacent chips 2, each connection via arespective instance of the sync interface 96. This way, the chips 2 canbe connected in one or more daisy chains via their sync blocks 95. Thisenables the sync requests, sync acknowledgments, running aggregates ofexit states, and global exit states, to be propagated up and down thechain.

In operation, for each sync group 91, 92, the sync block 95 associatedwith one of the chips 2 in that group is set as the master forsynchronization and exit state aggregation purposes, the rest in thegroup being slaves for this purpose. Each of the slave sync blocks 95 isconfigured with the direction (e.g. left or right) that it needs topropagate sync requests, sync acknowledgments and exit states for eachsync group 91, 92 (i.e. the direction toward the master). In embodimentsthese settings are configurable by software, e.g. in an initialconfiguration phase after which the configuration remains set throughoutthe subsequent operation of the system. For instance this may beconfigured by the host processor. Alternatively it is not excluded thatthe configuration could be hard-wired. Either way, the different syncgroups 91, 92 can have different masters and in general it is possiblefor a given chip 2 (or rather its sync block 95) to be master of onegroup and not another group of which it is a member, or to be master ofmultiple groups.

For instance, by way of illustration consider the example scenario ofFIG. 18. Say for the sake of example that the sync block 95 of chip 2IVis set as the master of a given sync group 91A. Consider now the firstchip 21 in the chain of chips 2, connected via their sync blocks 95 andinterface 96 ultimately to chip 2IV. When all the worker threads of thecurrent compute phase on the first chip 21 have executed an EXITinstruction, and the supervisors on all the (participating) tiles 4 haveall executed a SYNC instruction specifying the sync group 91A, then thefirst chip 21 signals its sync readiness to its respective associatedsync block 95. The chip 21 also outputs to its respective sync block 95its chip-level aggregated exit state (the aggregate of all the exitingworkers on all the participating tiles on the respective chip 21). Inresponse, the sync block 95 of the first chip 21 propagates a syncrequest (Sync_req) to the sync block 95 of the next chip 211 in thechain. It also propagates the exit state of the first chip 21 to thesync block 95 of this next chip 211. The sync block 95 of this secondchip 211 waits until the supervisors of its own (participating) tiles 4have all executed a SYNC instruction specifying the sync group 91A,causing the second chip 211 to signal sync readiness. Only then does thesecond chip's sync block 95 propagate a sync request to the sync block95 of the next (third) chip 2111 in the chain, and also propagates arunning aggregate of the exit state of the first chip 21 with that ofthe second 211. If the second chip 211 had become sync ready before thefirst 21, then the sync block 95 of the second chip 211 would havewaited for the first chip 21 to signal a sync request before propagatingthe sync request to the sync block 95 of the third chip 2111. The syncblock 95 of the third chip 2111 behaves in a similar manner, this timeaggregating the running aggregate exit state from the second chip 211 toobtain the next running aggregate to pass onwards, etc. This continuestoward the master sync block, that of chip 2IV in this example.

The sync block 95 of the master then determines a global aggregate ofall the exit states based on the running aggregate it receives and theexit state of its own chip 2IV. It propagates this global aggregate backout along the chain to all the chips 2, along with the syncacknowledgement (Sync_ack).

If the master is part way along a chain, as opposed to being at one endas in the above example, then the sync and exit state informationpropagates in opposite directions either side of the master, both sidestoward the master. In this case the master only issues the syncacknowledgment and global exit state once the sync request from bothsides has been received. E.g. consider the case where chip 2111 ismaster of group 92. Further, in embodiments the sync block 95 of some ofthe chips 2 could connect to that of three or more other chips 2, thuscreating multiple branches of chains toward the master. Each chain thenbehaves as described above, and the master only issues the syncacknowledgment and global exit state once the sync request from allchains has been received. And/or, one or more of the chips 2 couldconnect to an external resource such as the host processor, a networkcard, a storage device or an FPGA.

Note that the above is only the mechanism for propagating sync and exitstate information. The actual data (content) is transmitted by anotherchannel, for example as discussed later with reference to FIG. 19.Further, it will be appreciated that this is only one exampleimplementation, and the skilled person will be capable of building othercircuits for implementing the disclosed synchronization and aggregationfunctionality once given the specification of that functionalitydisclosed herein.

Regardless of the particular mechanism for signalling sync and exitstate information, according to the present invention there is provideda mechanism for enabling a host processor or subsystem 93 to communicatewith any work accelerator sub-system that operates with either a singlepoint of rendezvous for all its participants (such as BSP), or in someembodiments a sufficiently small number of points of rendezvous (such asa number of independent BSP accelerators all connected to one host) suchthat implementation of a host-processor friendly synchronisationmechanism can be implemented in hardware in a particularly efficientmanner. This situation may contrasted with a traditional CSP approach inwhich the number of points of rendezvous is application specific andthus the synchronization mechanisms such as semaphores must be softwaredefined and thus subject to inefficiencies that follow from this (e.g.processor interrupt latency).

The host 93 here may represent a host processor or CPU 93H, e.g. asdescribed in relation to FIG. 21; or a gateway processor 93GW of a widerhost subsystem, e.g. as described in relation to FIG. 22.

As shown in FIG. 18 (and referring also to FIG. 12), the overall systemcomprises at least one host processor 93, and an external host interface97 for connecting the host processor 93 to the external interconnect 72(including to the external sync logic 76). For example in embodimentsthe host interface 97 may take the form of a PCI interface. The synclogic 76 of the external interconnect 72 further comprises at least one“host sync proxy” (HSP) module 98. The HSP module 98 is connectedbetween the interface 97 and one of the sync blocks 95. The HSP module98 is arranged to act as a proxy on behalf of the host 93 forsynchronization purposes, to enable the host processor 93 to participatein the synchronization amongst at least one of the sync zones or groups91, 92, as will be discussed in more detail shortly.

In embodiments one HSP module 98 is provided per chip 2 and percorresponding sync block 95. In this case, whichever sync block 95 isconfigured as the master of a given sync group 91, 92, the HSP 98 ofthat sync block is set as the proxy of the host 93 within the group andthe other HSPs are disabled. Thus as with the sync blocks 95, the HSPs98 can be configured per sync group 91, 92. So one HSP 98 can be set asthe host proxy for one sync group, e.g. 91A or 91B, whilst another HSP98 can be set as the host proxy for another group, e.g. 91B or 92; orthe same HSP 98 may be set as the host proxy for multiple groups, e.g.both 91 and 92. To this end the host interface 97 is connected to theHSPs 98 so that the HSP 98 selected for each group 91, 92 may beconfigurable by software by writing to registers of the HSP modules 98via the PCI interface 97. Alternatively it is not excluded that theconfiguration could be hard-wired or the HSP registers updated via adifferent interface or protocol. It is also not excluded that in yetfurther alternative embodiments, there could be a single fixed HSP 98per sync group 91, 92, or even a single fixed HSP 98 for the whole arrayor subsystem 6.

The or each host sync proxy (HSP) module 98 comprises hardware circuitryconfigured to enable the host 93 to participate in the respective syncgroup 91, 92 in which that HSP 98 is arranged to act as the host'sproxy. A sync request emitted by the tiles 4, if it is a sync with hostinvolvement, will be conveyed by the sync logic 95 to the active HSP 98for that group whereas a sync request which does not specify hostinvolvement will be aggregated and returned to the requesting tileswithout involving the HSP 98 in any way. Thus the tiles 4 determine byvirtue of the program they execute when, if at all, the acceleratorrequires to interact with the host via the HSP 98.

By way of illustration, consider an instance of the HSP 98 configured toact as proxy of the host 93 with respect to the global sync group 92.E.g. in FIG. 18, purely by way of illustration. It will be appreciatedthat analogous functionality can be described for the host'sparticipation in any, lower level sync group also, such as thoselabelled 91.

The host 93 is asynchronous and non-time-deterministic with respect tothe rest of the sync group 92, and separated by a relatively largeamount of wiring and physical logic. In addition any communication withthe host likely requires the host to take an interrupt following whichthere is a considerable latency for handling the interrupt and thenswitching contexts to the host code that would deal with the syncrequest. These factors mean the latency of any interaction involving thehost 93 is poor. It would be desirable to avoid needing to communicatedirectly with the host 93 as much as possible.

To this end, the HSP 98 comprises a set of registers comprising at leastone counter 99, and associated counting logic arranged to operate asfollows. The counter 99 is arranged so that an integer value n can bewritten to it by the host 93 via the host interface 97, in embodimentssuch that the value written is added to the value already present inthis register 99. The number in the counter 99 may be described as anumber of credits, or a mark count (e.g. ipu_mark_count). When the HSPcounter has a value of 1 or greater than in the sync group 92 in whichthe HSP 98 in question is acting as the host's proxy, the HSP 98 is thenconfigured to generate a sync acknowledgement (sync_ack) when itreceives a sync request from the tiles 4 in the sync group 92. Theassociated counting logic automatically decrements n by one in thecounter 99 each time a sync acknowledgement is generated and thecorresponding barrier is passed (e.g. barrier 80 in the case of syncgroup 92). This process occurs without the requirement for the HSP tocontact or otherwise interrupt the host. But if the counter value n hasnow reached zero, the HSP does not generate the sync-acknowledge andtherefore does not allow the tiles 4 in the group 92 to continue runningagain until both: i) all the tiles 4 in that group 92 have sent a syncrequest (sync_req), and ii) the HSP 98 performs a write to the HSP 98via the host interface 97 explicitly granting the barrier to bereleased. In embodiments, this second subcondition ii) is implemented bythe HSP 98 checking that the HSP counter 99 now has a value of 1 orgreater—i.e. the counter has been granted with more credits again by thehost 93 writing to the counter 99 via the host interface 97. Thus thetiles 4 of the group can be allowed to continue running through nbarriers without deferring at all to the host 93, after which they mustthen synchronize with the host 93 (and may then exchange data to and/orfrom the host). See for example FIG. 20. In some cases, the host mayarrange its operation for maximum efficiency by ensuring that the HSPcounter value never falls to zero and thus the accelerator never pausesto sync with the host.

Preferably the software running on the tiles 4 is free to choose whetherto request HSP involvement or not, by collectively marking theirrespective sync requests as either requiring or not requiring hostinvolvement. In such embodiments the above behaviour is applied only bythe HSP 98 for the barriers corresponding to sync requests marked asrequiring host involvement (the “involvement” of the host for any givenbarrier being either the proxy granting of the sync ack by the HSP 98 onbehalf of the host, or occasionally the explicit granting of morecredit). The program is arranged so that all tiles 4 in a given group91, 92 signal the same choice in their sync requests (HSP involvement ornot) for a given barrier synchronization. In embodiments the hostinvolvement is selected by different variants of the mode of the SYNCinstruction. That is, for each sync group 91, 92, there is effectivelytwo variants that the operand of the SYNC instruction can take:zone_1_host, zone_1_no_host; and zone_2_host, zone_2_no_host. Theexecution unit 18 is configured to act upon the operand, and in responseto cause the synchronization logic in the interconnect 72, 76 to signalthe host involvement marker accordingly. In other embodiments however,it is not excluded that other mechanisms could be implemented forrequesting host involvement, or even (though less preferred) that hostinvolvement is hardwired and therefore always imposed (i.e. counter 99is always consulted).

Another function of the HSP 98 is to notify the host by writing anotification message directly to the host's memory (in this embodiment,over the PCI interface). The notification message includes the currentcontents of the HSP 98 which includes the aforementioned counter value.Optionally the HSP 98 can also be configured to interrupt the host atthis point. The host therefore has the option of waiting for aninterrupt from the HSP or of polling the memory location written by theHSP with either method serving to alert the host to the current newstate of the HSP including the value of its counter. The host programmay then take such measures as it requires in order to prepare forfuture barriers following which it posts incremental values to the HSPcounter.

In embodiments, preparation for barriers performed by the host mayinclude the preparation of data to be fetched by the accelerator, suchas experience data sets required by the accelerator for the next stagein learning a model. Preparation in this context may include fetchingthe data from storage disks or other media, formatting data in a formwhich is required by the training algorithm running on the acceleratoror decompression of image data. Additionally, preparation for barriersmay include consuming output data produced by the accelerator.

Another function of the HSP 98 is to communicate the exit state value ofthe accelerator that accompanies the sync request from the Tiles 4 tothe host 93, via the notification message mentioned previously.

Another function of the HSP 98 is to allow the host program to specifyits own exit state value by writing it to one of the HSP registers.Thereafter when the HSP 98 generates a sync-acknowledge for the tiles 4,the aggregated exit state of all the tiles 4 is also aggregated with theexit state value that has been provided by the host 93.

Another function of the HSP 98 is to allow the host program to specifyan expected exit state value which corresponds to the exit state it mostcommonly expects the tiles 4 to provide along with their sync request.When the host 93 provides an expected exit state in this way, then solong as the tiles 4 exit state matches the value provided by the hostthe operation of the HSP is as described previously, with the HSPgenerating a sync-acknowledge while the HSP counter value n is greaterthan zero. Alternatively if the host's expected exit state value doesnot match the value provided by the tile 4 then the HSP 98 does notgenerate a sync-acknowledge to the Tiles 4. Because the tile's exitstate 4 is provided during the notification write mentioned above andthe accelerator will be stalled at the barrier where the tile exit stateand host exit state differ, the host program is able to take suchbarrier preparation measures as may be required to satisfy theconditions signalled by the change in exit state and then re-establishthe counter value n such that the value reflects the new preparationsmade. To facilitate this re-establishment of the counter value, the HSPinterprets a write to the HSP register with a count value of zero as aninstruction to zero the counter value rather than to increment thecounter value by zero which would have the undesired effect of leavingthe counter value unchanged.

An unexpected exit state event as described above may entail abandoningprevious preparations made by the host in anticipation of the Tile exitstate matching the expected value but in general the loss of efficiencyresulting from this event is small compared to the loss of efficiencythat would be incurred if the accelerator had to interrupt or involvethe host directly at each barrier, so long as the occurrence of theunexpected exit state value is rare relative to occurrences of theexpected exit state value.

N.B. an equivalent counter 99 for decrementing the number of creditscould be implemented as a counter that starts at zero and thenautomatically increments up toward a target value held in a register.Other implementations may also be apparent to a person skilled in theart. By “decrement” herein, it is meant to refer to the underlyingsubstantive effect of counting out a remaining number of automaticallydiminishing credits, rather than to refer to a particular implementationin terms of logical counting direction or such like.

In embodiments, the HSP 98 associated with each chip 2 comprises aplurality of instances of the counter 99 and the associated countinglogic, one instance for each of some or all of the possible sync groups91, 92 of which the respective chip can potentially be a member. Thusthe HSP 98 can maintain a different number of sync credits for each ofmultiple sync groups 91, 92, e.g. multiple hierarchical levels.Alternatively a given HSP 98 only comprises one counter 99 formaintaining the sync credits for one sync group, but there are multipleHSPs each of which can be configured to act as described above in adifferent respective one of the groups 91, 92 (e.g. multiplehierarchical levels). For example as described above, in embodimentsthere is one HSP 98 per chip 2, each which can be attached to a givensync group 91, 92 by the host 93. In other alternatives, it is notexcluded that there is only a single global HSP 98 with only a singlecounter 99 for maintaining a number of sync credits for a single syncgroup, e.g. the global group 92.

Also, in general, note that it is possible for the above arrangement tobe applied to one or more host processors 93. For instance, one HSP 98can be configured to involve one host processor 93 in one of the syncgroups 91, 91, whilst another HSP may be configured to involve anotherhost processor in another of the sync groups 91, 92. In this case eachthe HSP 98 of each host 93 represents its respective host 93 in relationto the respective sync group 91, 92 in a similar manner to thatdescribed above. Or in another example, in some embodiments it may bepossible to involve two host processors 93 in the same sync group 91 or92. In this case, a given HSP 98 may include a separate counter 99 foreach host 93; or different HSPs 98 may be set for a given group, one foreach host 93. Either way, the counters 99 are written with a respectivenumber of sync credits by each respective host 93. When either counter99 has decremented to zero a sync acknowledgement to the tiles 4 willnot be issued.

As mentioned previously, not all tiles 4 need necessarily participate inthe synchronization. In embodiments, as discussed, the group ofparticipating tiles can be set by the mode operand of the syncinstruction. However, this only allows for selection of predefinedgroups of tiles. It is recognized herein that it would also be desirableto be able to select sync participation on a tile-by-tile basis.Therefore in embodiments, there is provided an alternative or additionalmechanism for selecting which individual tiles 4 participate in thebarrier synchronization.

Particularly, this is achieved by providing an additional type ofinstruction in the processor instruction set, to be executed by one orsome tiles 4 in place of the SYNC instruction. This instruction may bereferred to as the “abstain” instruction, or “SANS” instruction (startautomatic non-participatory sync). In embodiments the SANS is reservedfor use by the supervisor thread. In embodiments it takes a singleimmediate operand:

SANS n_barriers

The behaviour of the SANS instruction is to cause the tile on which itis executed to abstain from the current barrier synchronization, butwithout holding up the other tiles which are waiting for all tiles inthe specified sync group to SYNC. In effect it says “go on without me”.When the SANS instruction is executed, the opcode of the SANSinstruction triggers the logic in the execution unit of the executionstage 18 to send an instance of the synchronization request signal(Sync_req) to the internal and/or external sync controller 36, 76(depending on the mode). In embodiments, the sync request generated bythe SANS applies to any sync group 91, 92 that encompass the tile 4 thatexecuted the SANS. I.e. for whatever sync group the tiles 4 in thislocal chip or chips are using next (they must agree on the sync group),the sync_req from those that have executed SANS will always be valid.

Thus from the perspective of the sync controller logic 36, 76 and theother tiles 4 in the sync group, the tile 4 executing the SANSinstruction appears exactly as a tile 4 executing a SYNC instruction,and does not hold up the sync barrier and the sending of the syncacknowledgment signal (Sync_ack) from the sync logic 36, 76. I.e. thetiles 4 executing the SANS instead of the SYNC does not hold up or stallany of the other tiles 4 involved any sync group of which the tile inquestion is otherwise a member. Any handshake performed by a SANS isvalid for all sync groups 91, 92.

However, unlike the SYNC instruction, the SANS instruction does notcause supervisor instruction issue to be paused awaiting the syncacknowledgment signal (Sync_ack) from the sync logic 36, 76. Instead therespective tile can simply continue uninhibited by the current barriersynchronization that is being conducted between the other tiles 4 thatexecuted SYNC instructions. Thus by mimicking a sync but not waiting,the SANS instruction allows its tile 4 to press on with processing oneor more tasks whilst still allowing the other tiles 4 to sync.

The operand n_barriers specifies the number of “posted” syncs, i.e. thenumber of future sync points (barriers) the tile will not beparticipating in. Alternatively it is not excluded that in otherembodiments the SANS instruction does not take this operand, and insteadeach execution of the SANS instruction causes only a one-off abstention.

By means of the SANS instruction, certain tiles 4 may be responsible forperforming tasks outside the direct scope of the BSP operating schedule.For example, it may be desirable to allocate a small number of tiles 4within a chip 2 to initiate (and process) data transfers to and/or fromhost memory while the majority of tiles 4 are occupied with the primarycomputation task(s). In such scenarios those tiles 4 not directlyinvolved with primary computation can declare themselves as effectivelydisconnected from the synchronization mechanism for a period of timeusing the automatic non-participatory sync feature (SANS). When usingthis feature, a tile 4 is not required to actively (i.e. via executionof the SYNC instruction) signal its readiness for synchronization (forany of the synchronization zones), and in embodiments makes a nullcontribution to the aggregated exit status.

The SANS instruction begins or extends a period during which the tile 4on which it is executed will abstain from active participation ininter-tile synchronization (or synchronization with other externalresources if they are also involved in the synchronization). During thisperiod, this tile 4 will automatically signal its readiness forsynchronization, within all zones, and in embodiments also make a nullcontribution to the global aggregated consensus $GC. This time periodmay be expressed as an unsigned immediate operand (n_barriers)indicating how many additional future synchronization points will beautomatically signalled by this tile 4. Upon execution of the SANS, thevalue n_barriers specified by its operand is placed into a countdownregister $ANS_DCOUNT on the respective tile 4. This is a piece ofarchitectural state used to keep a track of how many additional futuresync_reqs should be made. If the automatic non-participatory syncmechanism is currently inactive, the first assertion of readiness (syncrequest, sync_req) will be performed immediately. Subsequent assertionswill occur in the background, once the previous synchronization hascompleted (i.e. following assertion of the sync acknowledgment,sync_ack). If the automatic non-participatory sync mechanism iscurrently active, the countdown counter register $ANS_DCOUNT will beupdated in an automatic manner, such that no sync acknowledgment signalis left unaccounted for. The automatic non-participatory sync mechanismis implemented in dedicated hardware logic, preferably an instance of itin each tile 4, though in other embodiments it is not excluded that itcould instead be implemented centrally for a group of tiles or alltiles.

With regard to the exit state behaviour, there are in fact a number ofpossibilities depending on implementation. In embodiments, to obtain theglobally aggregated exit state, the sync logic 36, 76 only aggregatesthe local exit states from those tiles 4 in the specified sync groupthat executed a SYNC instruction, and not those that/those that executeda SANS instruction (the abstaining tile or tiles). Alternatively, theglobally aggregated exit state is obtained by aggregating the local exitstates from all the tiles 4 in the sync group that executed a SYNC andthose that executed a SANS (both the participating and abstaining tiles4). In the latter case, the local exit state output by the abstainingtile(s) 4 for global aggregation may be the actual locally aggregatedexit state of that tile's workers at the time of executing the SANS,just as with the SYNC instruction (see description of local consensusregister $LC 38). Alternatively the local “exit state” output by theabstaining tile 4 may be a default value, for instance the true value(e.g. logic 1) in embodiments where the exit state is binary. Thisprevents the abstaining tile 4 from interfering with the global exitstate in embodiments where any false local exit state causes the globalexit state to be false.

Regarding the return of the global exit state, there are twopossibilities for this, regardless of whether or not the abstaining tilesubmits a local exit state for producing the global aggregate, andregardless of whether that value was an actual value or a default value.That is, in one implementation, the global aggregate exit state producedby the sync logic 36, 76 in the interconnect 34, 72 is stored only inthe global consensus registers $GC 42 of the participating tiles 4,which executed a SYNC instruction, and not the abstaining tiles 4 whichinstead executed a SANS instruction. In embodiments, instead a defaultvalue is stored in the global consensus register $GX 42 of the tile(s) 4that executed a SANS (the abstaining tiles). For instance this defaultvalue may be true, e.g. logic 1, in the case of a binary global exitstate. In an alternative implementation however, the actual globalaggregate produced by the sync logic 36, 76 is stored in the globalconsensus registers $GC 42 of both the participating tiles 4 whichexecuted SYNC instructions and the abstaining tiles 4 which insteadexecuted a SANS instruction. Thus all tiles in the group may still haveaccess to the globally aggregated exit state.

FIG. 13 illustrates an example BSP program flow involving both internal(on-chip) and external (inter-chip) synchronizations. As shown, the flowcomprises internal exchanges 50 (of data between tiles 4 on the samechip 2) and the external exchanges 50′ (of data between tiles 4 ondifferent chips 2).

As illustrated in FIG. 13, in embodiments it is disclosed to keep theinternal BSP supersteps (comprising the internal exchanges 50 of databetween tiles 4 on the same chip 2) separate from the external sync andexchange (comprising the external exchanges 50′ of data between tiles 4on different chips 2).

Accordingly, the program may be arranged to perform a sequence ofsynchronizations, exchange phases and compute phases comprising in thefollowing order: (i) a first compute phase, then (ii) an internalbarrier synchronization 30, then (iii) an internal exchange phase 50,then (iv) an external barrier synchronization 80, then (v) an externalexchange phase 50′. See chip 211 in FIG. 13. The external barrier 80 isimposed after the internal exchange phase 50, such that the program onlyproceeds to the external exchange 50′ after the internal exchange 50.Note also that as shown with respect to chip 21 in FIG. 12, optionally acompute phase may be included between internal exchange (iii) andexternal barrier (iv).

This overall sequence is enforced by the program (e.g. being generatedas such by the compiler). In embodiments the program is programmed toact in this way by means of the SYNC instruction described previously.The internal synchronization and exchange does not extend to any tilesor other entities on another chip 2. The sequence (i)-(v) (with theaforementioned optional compute phase between iii and iv) may berepeated in a series of overall iterations. Per iteration there may bemultiple instances of the internal compute, sync and exchange (i)-(iii)prior to the external sync & exchange. I.e. multiple instances of(i)-(iii) (retaining that order), i.e. multiple internal BSP supersteps,may be implemented before (iv)-(v), i.e. the external sync and exchange.Note also, any of the tiles 4 may each be performing their own instanceof the internal synchronization and exchange (ii)-(iii) in parallel withthe other tiles 4.

Thus per overall BSP cycle (i)-(v) there is ensured to be at least onepart of the cycle (ii)-(iii) wherein synchronization is constrained tobeing performed only internally, i.e. only on-chip.

Note that during an external exchange 50 the communications are notlimited to being only external: some tiles may just perform internalexchanges, some may only perform external exchanges, and some mayperform a mix. However, due to the loss of time determinism that occursin the external interconnect 72 in some embodiments, then in suchembodiments, once a tile has performed an external communication itcannot perform an internal communication again until the nextsynchronization (see below explanation of the preferred on-chipcommunication mechanism which relies on predetermined knowledge ofmessage timing and inter-tile delays).

In some embodiments, also as shown in FIG. 13, some tiles 4 may performlocal input/output during a compute phase, for example they may exchangedata with a host. Note also that as shown in FIG. 13, it is in generalpossible for any or all tiles to have a null compute phase 52 or a nullexchange phase 50 in any given BSP superstep.

In embodiments, the different levels of sync zones 91, 92 may be used toconstrain the extent of some of the external sync & exchange operationsto only a subgroup of the chips 2 in the system, and limit the number oftimes the penalty of a full, global sync and exchange is needed. Thatis, the overall cycle may comprise: (i) a first compute phase, then (ii)an internal barrier synchronization, then (iii) an internal exchangephase, then (iv) an external barrier synchronization 80 within the tilesof only a first, lower level sync zone 91; then (v) an external exchangephase between only the chips of the first sync zone 91; then (vi) anexternal barrier synchronization across a second, higher level sync zone92; then (vii) an external exchange phase amongst the chips of thesecond level sync zone 92. The external barrier to the second levelexchange phase is imposed after the first level external exchange phase,such that the program only proceeds to the second level externalexchange after the first level exchange phase. This behaviour may beprogrammed by using the SYNC instruction qualified by different levelsof the external mode in its operand.

In embodiments the highest hierarchical level of sync zone encompassesall the tiles 4 on all chips 2 in the array 6, i.e. it is used toperform a global sync. When multiple lower-level zones are used, BSP maybe imposed internally amongst the group of tiles 4 on the chip(s) 2within each zone, but each zone may operate asynchronously with respectto one another until a global sync is performed.

Note: with regard to the lower-level external synchronization andexchange (iv)-(v), any of the lower-level zones 91A, 91B may each beperforming its own instance of the lower-level external exchange inparallel with the other lower-level zone(s). And/or, in some casesmultiple instances of (i)-(v) may be implemented before (vi)-(vii), i.e.there may be multiple instances of the lower-level external BSPsuperstep before the external sync and exchange. Further, the schemecould be extended to three or more hierarchical levels of sync zone.

In general the host 93 may be involved in any one or more of thehierarchical levels of sync.

An example is illustrated schematically in FIG. 20 for the global synczone 92. The system is allowed to perform a number P of BSP iterationsp, passing through P sync barriers 80, before a barrier 90 alsorequiring sync acknowledgment from the host 93 is imposed. The P syncbarriers require sync requests from all the (non abstaining) tiles 4 inthe relevant sync group 92 but not the host 93. The subsequent syncbarrier 80 requires sync requests from all the (non abstaining) tiles 4in the sync group 92 and that the host 93 has previously indicatedpermission to pass the particular barrier. After this barrier 90 anexchange 50″ may be performed between the host 93 and one or more of thetiles 4, e.g. for one or more of the tiles 4 to report computationresults to the host 93.

The following describes an exemplary mechanism for communicating on-chip(internal exchange) without the need for queues. Reference is made toFIG. 16. The communication without queues can be achieved by thecompiler knowing the time at which each tile 4 transmits its data, andalso knowing the on-chip inter-tile delay between the transmitting andreceiving tile. Given this predetermined knowledge, the compiler canthen program the receiving tile to listen to the address of thetransmitting tile at a specific, known time after the transmission ofthe relevant data by the transmitting tile, i.e. the transmit time plusthe inter-tile delay. The timing of the transmission is known by thecompiler because the compiler itself selects at which point in eachthread to include the send instruction(s). Further, the inter-tiledelay, for on-chip communications, is a fixed knowable value for a givenpair of transmitting and receiving tiles 4. The compiler may know thisfrom a look-up table of inter-tile delays for different possiblecombinations of sending and receiving tiles. The compiler can theninclude the corresponding receive instruction, to listen to the sender'saddress, at the corresponding number of cycles after the transmitinstruction.

On each chip 2, the chip 2 comprises a respective clock which controlsthe timing of chip activity. The clock is connected to all of the chip'scircuits and components. The chip 2 also comprises the internal,time-deterministic interconnect or “switching fabric” 34 to which alltiles and links are connected by sets of connection wires. Inembodiments the interconnect 34 may be stateless, in that it has nostate readable by software. Each set of connection wires is fixed end toend. The wires are pipelined. Each set can carry a packet consisting ofone or more datums, with one datum being transferred per clock cycle.But note herein that the word “packet” denotes a set of bitsrepresenting a datum (sometimes referred to herein as a data item),perhaps with one or more valid bit. The “packets” do not have headers orany form of destination identifier (which permits an intended recipientto be uniquely identified), nor do they have end-of-packet information.Instead, they each represent a numerical value input to or output from atile. Each tile has its own local memory (described later). The chip 2has no shared memory. The switching fabric 24 constitutes a cross set ofconnection wires only and also does not hold any state. Data exchangebetween tiles on the same chip is conducted on a time deterministicbasis as described herein. A pipelined connection wire comprises aseries of temporary stores, e.g. latches or flip flops which hold datumfor a clock cycle before releasing it to the next store. Time of travelalong the wire is determined by these temporary stores, each one usingup a clock cycle of time in a path between any two points.

Each tile 4 indicates its synchronisation state to the sync controller36 in the internal interconnect 34. Once it has been established thateach tile 4 is ready to send data, the synchronisation process 30 causesthe system to enter the exchange phase 50. Note that each tileexperiences the sync_ack with a different but known time delay. Thesupervisor program inserts additional cycle delays as required such thateach tile begins its exchange phase on the exact same cycle. In thisexchange phase, data values move between tiles (in fact between thememories of tiles in a memory-to-memory data movement). In the exchangephase, there are no computations and therefore no concurrency hazards(or at least there are no computations that reply on data yet to bereceived from another tile 4). In the exchange phase, each datum movesalong the connection wires on which it exits a tile from a transmittingtile to its recipient tile. At each clock cycle, datum moves a certaindistance along its path (store to store), in a pipelined fashion. When adatum is issued from a tile, it is not issued with a header identifyinga recipient tile. Instead, the recipient tile knows that it will beexpecting a datum from a certain transmitting tile at a certain time.Thus, the computer described herein is time deterministic.

Each tile 4 runs a portion of the program which has been allocated to itby the programmer or by a compiler exercise, where the programmer or thecompiler function has knowledge of what will be transmitted by aparticular tile at a certain time and what needs to be received by arecipient tile at a certain time. In order to achieve this, SENDinstructions are included in the local programs executed by theprocessor on each tile, where the time of execution of the SENDinstruction is predetermined relative to the timing of otherinstructions being executed on other tiles in the computer.

Each tile 4 is associated with its own multiplexer 210. Each multiplexerhas at least as many inputs as there are tile 4 on the chip, each inputbeing connected to the switching fabric 34. The cross wires of theswitching fabric are connected to a data-out set of connection wires 218from each tile (a broadcast exchange bus). For ease of illustration, notall crosswire are shown in FIG. 16. One set of crosswires is labelled140 x to indicate that it is one of a number of sets of crosswires.

When the multiplexer 210 is switched to the input labelled 220 x thenthat will connect to the crosswires 140 x and thus to the data bus 218Tof the transmitting (sending) tile 4T. If the multiplexer is controlledto switch to that input at a certain time, then the datum received onthe data bus 230 which is connected to the crosswire 140 x will appearat the output of the multiplexer 210 at a certain time. It will arriveat the receiving tile 4R a certain delay after that, the delay dependingon the distance of the multiplexer 210 from the receiving tile 4R. Asthe multiplexers tend to be arranged close to the switching fabric, thedelay from the tile to the multiplexer can vary depending on thelocation of the receiving tile 4R.

To implement the switching, the local programs executed on the tiles 4include switch control instructions (PUTi) which cause a multiplexercontrol signal 214 to be issued to control the multiplexer 210associated with that tile to switch its input at a certain time ahead ofthe time at which a particular datum is expected to be received at thetile. In the exchange phase, multiplexers are switched and packets(data) are exchanged between tiles using the switching fabric. It can beseen from this explanation that the internal interconnect 34 has nostate and requires no queues—the movement of each datum is predeterminedby the particular crosswire to which the input of each multiplexer isconnected.

In the exchange phase, all tiles 4 are permitted to communicate with allother tiles within its sync group. Each tile 4 has control of its ownunique input multiplexer 210. Incoming traffic can thus be selected fromany other tile in the chip 2 (or from one of the external connectionlinks in an external exchange). It is also possible for a multiplexer210 to be set to receive a null input, i.e. no input, in any givenexchange phase.

Each tile 4 has three interfaces: an “exin” interface 224 which passesdata from the switching fabric 34 to the tile 4; an “exout” interface226 which passes data from the tile to the switching fabric over thebroadcast exchange bus 218; and an “exmux” interface 228 which passesthe control mux signal 214 (mux-select) from the tile 4 to itsmultiplexer 210.

In order to ensure each individual tile executes SEND instructions andswitch control instructions at appropriate times to transmit and receivethe correct data, exchange scheduling requirements need to be met by theprogrammer or compiler that allocates individual programs to theindividual tiles in the computer. This function is carried out by anexchange scheduler, preferably at compile time, which needs to be awareof the following parameters.

Parameter I: the relative SYNC acknowledgement delay of each tile. Thisis a function of tile ID (TID) of the sending and receiving tiles, whichis held in the TILE_ID register. This is a number of cycles alwaysgreater than or equal to 0 indicating when each tile receives the syncack signal from the sync controller 36 relative to all other tiles. Thiscan be calculated from the tile ID, noting that the tile ID indicatesthe particular location on the chip of that tile, and therefore reflectsthe physical distances. Put another way, the sync ack delays areequalized. If the transmitted tile 4T is closer to the sync controller36 and the receiving tile 4R is further away, the consequence is thatthe sync acknowledgement delay will be shorter to the transmitting tile4T than for the receiving tile 4R, and vice versa. A particular valuewill be associated with each tile for the sync acknowledgement delay.These values can be held for example in a delay table, or can becalculated on the fly each time based on the tile ID.

Parameter II: the exchange mux control loop delay. This is the number ofcycles between issuing an instruction (PUTi MUXptr) that changes atile's input mux selection and the earliest point at which the same tilecould issue a (hypothetical) load instruction for exchange data storedin memory as a result of the new mux selection. This comprises the delayof the control signal getting from the exmux interface 228R ofrecipients tile 4R to its multiplexer 210R and the length of the linefrom the output of the multiplexer to the data input exin interface 224.

Parameter III: the tile to tile exchange delay. This is the number ofcycles between a SEND instruction being issued on one tile and theearliest point at which the receiving tile could issue a (hypothetical)load instruction pointing to the sent value in its own memory. This canbe calculated from the TIDs of the sending and receiving tiles, eitherby accessing a table, or by calculating on the fly. This delay includesthe time taken for data to travel from transmit tile 4T from its exoutinterface 226T to the switching fabric 14 along its exchange bus 218Tand then via the input mux 210R at the receiving tile 4R to the ex ininterface 224R of the receiving tile.

Parameter IV: the exchange traffic memory pointer update delay. This isthe number of cycles between issuing an instruction (PUTi MEMptr) thatchanges a tile's exchange input traffic memory pointer 232 and theearliest point at which that same tile could issue a (hypothetical) loadinstruction for exchange data stored in memory as a result of the newpointer. This is a small, fixed number of cycles. The memory pointer 232acts as a pointer into the data memory 202 and indicates where incomingdata from the exin interface 224 is to be stored.

Together these parameters give the total inter-tile delay that will beexperienced between transmission of a datum from the transmitting tile4T and receipt of that datum by the receiving tile 4R. The particularexchange mechanism and parameters above are given only by way ofexample. Different exchange mechanisms may differ in the exactcomposition of the delay, but as long as the exchange is kept timedeterministic, then it can be known by the programmer or compiler andthus exchange without queues is possible.

FIG. 17 shows the example exchange timings in more depth. On theleft-hand side are shown the chip clock cycles running from 0-30. If theprocessor of the receiving tile 4R wants to act on a datum which was theoutput of a process on the transmitting tile 4T, then the transmittingtile 4T has to execute a SEND instruction send at a certain time (e.g.clock cycle 0 in FIG. 17), and the receiving tile 4R has to execute aswitch control instruction PUTi EXCH MXptr (as in clock cycle 11) by acertain time relative to the execution of the SEND instruction on thetransmitting tile. This will ensure that the data arrives at therecipient tile in time to be loaded for use in a code-let being executedat the recipient tile 4R.

FIG. 19 illustrates an exemplary mechanism for communicating off-chip(external exchange). This mechanism is non-time-deterministic. Themechanism is implemented in dedicated hardware logic in the externalinterconnect 72. Data is sent over the external interconnect 72 in theform of packets. Unlike the packets sent over the internal interconnect,these packets have headers: as the order of transmission can change,they require the destination address to be present in the packet header.Also in embodiments the external interconnect 72 takes the form of anetwork and therefore requires additional information for routingpurposes.

At the physical layer the interconnect mechanism is lossy, but at thetransaction layer the mechanism is not lossy due to the architecture ofthe link layer: if a packet is not acknowledged it will be resentautomatically by the hardware in the interconnect 72. The possibilityfor loss and resending at the data link layer however means that thedelivery of data packets over the external interconnect is nottime-deterministic. Further, all the packets of a given exchange mayarrive together or separated apart in time, and in any order, so theexternal interconnect requires flow control and queuing. Further, theinterconnect may use clock-data-recovery (CDR) technology to infer aclock from a received data stream having sufficient data signaltransitions to maintain bit-lock. This inferred clock will be of unknownphase relationship to the sending clock and hence represent anadditional source of non-determinism.

As illustrated, the external interconnect 72 comprises an externalexchange block (XB) 78. The compiler nominates one of the tiles 4 tosend an external exchange request (XREQ) to the exchange block 78(operation S1). The XREQ is a message comprising one or more controlpackets, indicating which of the tiles 4 have data packets (content) tosend to another tile or tiles 4 on another chip 2. This is illustratedschematically in FIG. 19 by the ticks and crosses: by way of an examplescenario, those labelled with a tick have data packets to sendexternally and those labelled with a cross do not. In operation S2, theexchange block 78 sends an exchange-on (XON) control packet to a firstof the tiles 4 with data to send externally. This causes the first tileto start sending its packets to the relevant destination via theexternal interconnect 78 (operation S3). If at any time the XB is unableto continue sending packets to the interconnect (e.g. due to a previouspacket loss and retransmission in the interconnect, or due toover-subscription of the external interconnect by many other XBs andtiles) the XB will send an exchange-off (XOFF) to that tile before theXBs queue overflows. Once the congestion is cleared and the XB again hassufficient space in its queue it will send an XON to the tile allowingit to continue transmitting its content. Once this tile has sent itslast data packet, then in operation S4 the exchange block 78 sends anexchange-off (XOFF) control packet to this tile, then in operation S5sends another XON to the next tile 4 with data packets to send, and soforth. The signalling of XON and XOFF are implemented as a hardwaremechanism in dedicated hardware logic in the form of the externalexchange block 78.

It will be appreciated that this is just one example of a flow controlmechanism for communicating external between chips. Other suitablemechanisms, in themselves, will be familiar to a person skilled in theart. Also, the possibility of a time-deterministic and/or queue-lessexternal interconnect is not excluded.

FIG. 15 illustrates an example application of the processor architecturedisclosed herein, namely an application to machine intelligence.

As will be familiar to a person skilled in the art of machineintelligence, machine intelligence begins with a learning stage wherethe machine intelligence algorithm learns a knowledge model. The modelcomprises a graph of interconnected nodes (i.e. vertices) 102 and edges(i.e. links) 104. Each node 102 in the graph has one or more input edgesand one or more output edges. Some of the input edges of some of thenodes 102 are the output edges of some others of the nodes, therebyconnecting together the nodes to form the graph. Further, one or more ofthe input edges of one or more of the nodes 102 form the inputs to thegraph as a whole, and one or more of the output edges of one or more ofthe nodes 102 form the outputs of the graph as a whole. Sometimes agiven node may even have all of these: inputs to the graph, outputs fromthe graph and connections to other nodes. Each edge 104 communicates avalue or more often a tensor (n-dimensional matrix), these forming theinputs and outputs provided to and from the nodes 102 on their input andoutput edges respectively.

Each node 102 represents a function of its one or more inputs asreceived on its input edge or edges, with the result of this functionbeing the output(s) provided on the output edge or edges. Each functionis parameterized by one or more respective parameters (sometimesreferred to as weights, though they need not necessarily bemultiplicative weights). In general the functions represented by thedifferent nodes 102 may be different forms of function and/or may beparameterized by different parameters.

Further, each of the one or more parameters of each node's function ischaracterized by a respective error value. Moreover, a respectivecondition may be associated with the error(s) in the parameter(s) ofeach node 102. For a node 102 representing a function parameterized by asingle parameter, the condition may be a simple threshold, i.e. thecondition is satisfied if the error is within the specified thresholdbut not satisfied if the error is beyond the threshold. For a node 102parameterized by more than one respective parameter, the condition forthat node 102 having reached an acceptable level of error may be morecomplex. For example, the condition may be satisfied only if each of theparameters of that node 102 falls within respective threshold. Asanother example, a combined metric may be defined combining the errorsin the different parameters for the same node 102, and the condition maybe satisfied on condition that the value of the combined metric fallswithin a specified threshold, but otherwise the condition is notsatisfied if the value of the combined metric is beyond the threshold(or vice versa depending on the definition of the metric). Whatever thecondition, this gives a measure of whether the error in the parameter(s)of the node falls below a certain level or degree of acceptability. Ingeneral any suitable metric may be used. The condition or metric may bethe same for all nodes, or different for different respective ones ofthe nodes.

In the learning stage the algorithm receives experience data, i.e.multiple data points representing different possible combinations ofinputs to the graph. As more and more experience data is received, thealgorithm gradually tunes the parameters of the various nodes 102 in thegraph based on the experience data so as to try to minimize the errorsin the parameters. The goal is to find values of the parameters suchthat the output of the graph is as close as possible to a desired outputfor a given input. As the graph as a whole tends toward such a state,the graph is said to converge. After a suitable degree of convergencethe graph can then be used to perform predictions or inferences, i.e. topredict an outcome for some given input or infer a cause for some givenoutput.

The learning stage can take a number of different possible forms. Forinstance, in a supervised approach, the input experience data takes theform of training data, i.e. inputs which correspond to known outputs.With each data point, the algorithm can tune the parameters such thatthe output more closely matches the known output for the given input. Inthe subsequent prediction stage, the graph can then be used to map aninput query to an approximate predicted output (or vice versa if makingan inference). Other approaches are also possible. For instance, in anunsupervised approach, there is no concept of a reference result perinput datum, and instead the machine intelligence algorithm is left toidentify its own structure in the output data. Or in a reinforcementapproach, the algorithm tries out at least one possible output for eachdata point in the input experience data, and is told whether this outputis positive or negative (and potentially a degree to which it ispositive or negative), e.g. win or lose, or reward or punishment, orsuch like. Over many trials the algorithm can gradually tune theparameters of the graph to be able to predict inputs that will result ina positive outcome. The various approaches and algorithms for learning agraph will be known to a person skilled in the art of machine learning.

According to an exemplary application of the techniques disclosedherein, each worker thread is programmed to perform the computationsassociated with a respective individual one of the nodes 102 in amachine intelligence graph. In this case at least some of the edges 104between nodes 102 correspond to the exchanges of data between threads,and some may involve exchanges between tiles. Furthermore, theindividual exit states of the worker threads are used by the programmerto represent whether or not the respective node 102 has satisfied itsrespective condition for convergence of the parameter(s) of that node,i.e. has the error in the parameter or parameters fallen within theacceptable level or region in error space. For instance, this is oneexample use of the embodiments where each of the individual exit statesis an individual bit and the aggregated exit state is an AND of theindividual exit states (or equivalently an OR if 0 is taken to bepositive); or where the aggregated exit state is a trinary valuerepresenting whether the individual exit states were all true, all falseor mixed. Thus, by examining a single register value in the exit stateregister 38, the program can determine whether the graph as whole, or atleast a sub-region of the graph, has converged to an acceptable degree.

As another variant of this, embodiments may be used where theaggregation takes the form of a statistical aggregation of individualconfidence values. In this case each individual exit state represents aconfidence (e.g. as a percentage) that the parameters of the noderepresented by the respective thread have reached an acceptable degreeof error. The aggregated exit state can then be used to determine anoverall degree of confidence as to whether the graph, or a subregion ofthe graph, has converged to an acceptable degree.

In the case of a multi-tile arrangement 6, each tile runs a subgraph ofthe graph. Each subgraph comprises a supervisor subprogram comprisingone or more supervisor threads, and a set of worker threads in whichsome or all of the workers may take the form of codelets.

It will be appreciated that the above embodiments have been described byway of example only.

The above has described various exampled techniques whereby a secondprocessor (e.g. accelerator) 2 can send to a first processor (e.g. host)93H/GW a descriptor of an interaction intended for the next step s+1, inorder for the first processor to prepare its memory 306. More generallythis principle can be extended to other preparatory operations, notlimited to memory. E.g. if host or first CPU is controlling somebufferless routing fabric between the second subsystem and some other,remote system, then the parameter(s) could comprise a source ofdestination address in the remote system and the preparation by thefirst (routing) subsystem could comprise setting the routing switches ofthe routing fabric.

A step for the present purposes can be any instance of a period of timethat the second processor executes for that has an external visibleeffect. A step is not necessarily a BSP superstep, for example becausesome BSP steps have no external effect. Further, the applicability ofthe present disclosure is not necessarily limited to a BSP scheme. Noris it necessarily limited to the use of a host sync proxy 98, nor theparticular scheme of sync requests and acks, nor the sync network 96, asthe mechanism for implementing synchronization. More generally thedisclosed concepts can apply to any synchronization scheme whereby steps(stages of execution) are separated by barrier synchronizationsinvolving synchronization between any first and second processingsubsystem.

The scope of the disclosure is also not limited to a second subsystem300 comprising multi-tile processor chips, nor multiple processors orchips. It is also not limited to gateways. More generally the techniqueof sending an advance descriptor can be applicable to any arrangement ofhost subsystem and accelerator subsystem, where the host subsystemcomprises one or more host processors and the accelerator comprises oneor more accelerator subsystems. Further, the two subsystems do notnecessarily have to have a host-accelerator relationship. Can beapplicable in any scenario where one processor is required to have dataor memory space available for another processor in a subsequent stepbeyond a barrier synchronization.

On a given tile or processor, the implementation is not limited to theabove-described architecture in which a separate context is provided forthe supervisor thread, or in which the supervisor thread runs in a slotand then relinquishes its slot to a worker. The supervisor could insteaduse a general purpose context. Or in another arrangement for example,the supervisor may run in its own dedicated slot. Further, theimplementation is not limited to specific one of the threads even havinga supervisor role, or indeed to multi-threading at all. The techniquesdisclosed herein may even be used in scenarios where one, some or all ofthe tiles on one, some or all of the chips employ non-multithreadedexecution.

Where used, the applicability of a host sync proxy is not limited tosystems allowing selection between different sync groupings. Even in asystem having only a single sync domain (single group of tiles 4 acrosswhich a barrier synchronization is performed), it would still bebeneficial to be able to reduce the amount of host interaction bysetting a certain number of barriers that the tiles 4 are allowed topass through before deferring to the host 93.

Further, though embodiments have been exemplified in terms of a PCIinterface between cards or with the host 93, this is not limiting andother types of interface could be used, e.g. Ethernet.

Further, the scope of the present disclosure is not limited to atime-deterministic internal interconnect or a non-time-deterministicexternal interconnect. The mechanism disclosed herein can also be usedin a completely time-deterministic arrangement, or in a completelynon-time-deterministic arrangement.

Where a split between time-deterministic and non-time-deterministicrealms is used, it would also be possible to make the divide between thetime-deterministic and non-time-deterministic realms in other ways. Forinstance it is not excluded to extend the time-deterministic domainacross multiple chips 2, with different multi-chip time deterministicdomains being connected by a non-time-deterministic interconnect (e.g.the different multi-chip time-deterministic domains being implemented ondifferent cards or server chassis). Or as another example, differenttime-deterministic domains could be implemented on a given chip 2, witha non-time-deterministic on-chip interconnect being provided betweensuch domains.

Further, where a time-deterministic interconnect is used, theimplementation is not limited to use of an inter-tile delay look uptable. Instead for example an analytical formula could be used todetermine the inter-tile delay. Further, the inter-tile delay and thesend and receive timings are not limited to being set by the compiler.E.g. alternatively they could be arranged manually by the programmer.

Where multithreaded tiles are used, the terms “supervisor” and “worker”do not necessarily have to imply specific responsibilities expect whereotherwise explicitly stated, and particularly are do not in themselvesnecessarily limit to the above-described scheme in which a supervisorthread relinquishes its time slot to a worker, and so forth. In general,worker thread may refer to any thread to which some computational taskis allocated. The supervisor may represent any kind of overseeing orcoordinating thread responsible for actions such as: assigning workersto barrel slots (execution channels), and/or performing barriersynchronizations between multiple threads, and/or performing anycontrol-flow operation (such as a branch) in dependence on the outcomeof more than one thread.

Where reference is made to a sequence of interleaved time slots, or thelike, this does not necessarily imply that the sequence referred tomakes up all possible or available slots. For instance, the sequence inquestion could be all possible slots or only those currently active. Itis not necessarily precluded that there may be other potential slotsthat are not currently included in the scheduled sequence.

The term tile as used herein does not necessarily limit to anyparticular topography or the like, and in general may refer to anymodular unit of processing resource comprising a processing unit 10 andcorresponding memory 11, in an array of like modules, typically on thesame chip (same die).

Furthermore, where reference is made herein to performing asynchronization or an aggregation between a group of tiles, or aplurality of tiles or the like, this does not necessarily have to referto all tile on the chip or all tiles in the system unless explicitlystated. E.g. the SYNC and EXIT instructions could be configured toperform the synchronization and aggregation only in relation to acertain subset of tiles 4 on a given chip and/or only a subset of chips2 in a given system; whilst some other tiles 4 on a given chip, and/orsome other chips in a given system, may not be involved in a given BSPgroup, and could even be being used for some completely separate set oftasks unrelated to the computation being performed by the group at hand.

Further, the above-described synchronization schemes do not exclude theinvolvement, in embodiments, of external resources that are notprocessors such as one or more network cards, storage devices and/orFPGAs. For instance, some tiles may elect to engage in data transferswith an external system where these transfers form the computationalburden of that tile. In this case the transfers should be completedbefore the next barrier. In some cases the exit state of the tile maydepend on a result of the communication with the external resource, andthis the resource may vicariously influence the exit state.Alternatively or additionally, resources other than multi-tileprocessors, e.g. the host or one or more FPGAs, could be incorporatedinto the synchronization network itself. That is to say, a sync signalsuch as a Sync_req is required from this/these additional resources inorder for the barrier synchronization to be satisfied and the tiles toproceed to the next exchange phase. Further, in embodiments theaggregated global exit state may include in the aggregation an exitstate of the external resource, e.g. from an FPGA.

Also, while certain modes of SYNC instruction have been described above,the scope of the present disclosure more generally is not limited tosuch modes. For instance, the list of modes given above is notnecessarily exhaustive. Or in other embodiments, the SYNC instructionmay have fewer modes, e.g. the SYNC need not support differenthierarchical levels of external sync, or need not distinguish betweenon-chip and inter-chip syncs (i.e. in an inter-tile mode, always acts inrelation to all tiles regardless of whether on chip or off chip).

In further variations, the SYNC instruction could take a greater numberof possible modes to accommodate a greater granularity or range ofhierarchical sync zones 91, 92; or simply a different set of modes toaccommodate different division of the system into hierarchical zones.For instance, as well as allowing selection between internal (on-chip)and external (off-chip) synchronization (or even as an alternative tothis), the modes of the SYNC instruction may be configured to recognizeother physical breakpoints further out beyond one chip (e.g. one ICpackage, one card, one box of cards etc.). Or even if no dedicated SYNCinstruction is used, such divisions may be implemented by the programmeror compiler using general purpose code. So in embodiments, one of thehierarchical sync zones (e.g. one of the modes of the SYNC instruction)may consist of all the tiles on all the chips on the same IC package(but none of the tiles or chips beyond that). Alternatively oradditionally, one of the hierarchical sync zones (e.g. again one of themodes of the SYNC instruction) may consist of all the tiles on all thechips on the same card (but none of the tiles, chips or packages beyondthat). As another alternative or additional example, one of thehierarchical sync zones (e.g. again another possible mode of the SYNCinstruction) may consist of all the tiles on all the chips on all thecards in the same physical box, e.g. same chassis (but none of thetiles, chips or boxes beyond that). This would be advantageous becausecommunication between IC packages, cards and boxes will tend to incur aneven greater penalty than just between chips (dies) in the same package.

Furthermore, the sync zones are not limited to being hierarchical (i.e.one nested in another), and in other embodiments the selectable synczones may consist of or include one or more non-hierarchical groups (alltiles of that group not nested within a single other selectable group).

In yet further variants, the synchronization is not limited to beingperformed using dedicated SYNC instructions, nor the EXIT instructions.In other cases the synchronization functionality could be achieved usinggeneral purpose code. Further, where the SYNC instruction and/or EXITinstructions are used, they do not necessarily have to have thedescribed function of aggregating exit states.

Other applications and variants of the disclosed techniques may becomeapparent to a person skilled in the art once given the disclosureherein. The scope of the present disclosure is not limited by thedescribed embodiments but only by the accompanying claims.

The invention claimed is:
 1. A processing system comprising: a firstsubsystem comprising one or more first processors, and a secondsubsystem comprising one or more second processors; wherein the secondsubsystem is configured to process code over a series of steps; whereinthe second subsystem is configured, in a current one of said steps, tosend a descriptor to the first subsystem specifying a value of each ofone or more parameters of each of one or more interactions that thesecond subsystem is programmed to perform with the first subsystem viaan inter-processor interconnect in a subsequent one of said steps; andwherein the first subsystem is configured to execute a portion of codeto perform one or more preparatory operations, based on the specifiedvalues of at least one of the one or more parameters of each interactionas specified by the descriptor, to prepare for said one or moreinteractions prior to said subsequent step.
 2. The processing system ofclaim 1, wherein within said series of steps, each next step in theseries is delineated from its preceding step by a barriersynchronization whereby the second subsystem waits to advance to thenext step until the second subsystem receives a synchronizationacknowledgement signal indicating that the advancement is agreed by thefirst subsystem.
 3. The processing system of claim 1, wherein the one ormore preparatory operations are to prepare for said one or moreinteractions prior to a barrier synchronization leading into saidsubsequent step.
 4. The processing system of claim 1, wherein: the firstsubsystem stores one or more look-up tables mapping each of a set ofbehaviour IDs to a different respective one of a plurality of differentpossible predetermined definitions for said interaction, each definitioncomprising a respective set of values for said one or more parameters;the descriptor specifies the specified values of the one or moreparameters of each interaction by indicating one of the behaviour IDs;and the first subsystem is configured to determine the specified valuesby looking up the definition mapped to the indicated behaviour ID insaid one or more look-up tables, and to perform said one or morepreparatory operations based on the respective set of values of thelooked-up definition.
 5. The processing system of claim 1, wherein atleast one of the one or more interactions is to transfer data betweenthe second subsystem and a memory of the first subsystem, and whereinthe one or more preparatory operations comprise one or more operationsto prepare the memory for the transfer.
 6. The processing system ofclaim 5, wherein the at least one parameter comprises a direction of thetransfer, the direction being either: incoming from the second subsystemto the memory of the first subsystem, or outgoing from the memory of thefirst subsystem to the second subsystem.
 7. The processing system ofclaim 5, wherein the transfer comprises transferring an incoming portionof data from the second subsystem to the memory of the first subsystem,wherein said at least one parameter comprises at least a size of theincoming portion of data, and wherein said one or more preparatoryoperations comprise at least: reserving a corresponding amount of spacein the memory ready to accept the incoming portion of data from thesecond subsystem in the subsequent step.
 8. The processing system ofclaim 1, wherein the transfer comprises transferring an outgoing portionof data to the second subsystem from the memory of the first subsystem,wherein said at least one parameter comprises at least a size of theoutgoing portion of data, and wherein said one or more preparatoryoperations comprise one, more or all of: reserving a correspondingamount space in the memory to store the outgoing portion of data,generating the outgoing portion of data, and storing the outgoingportion of data in the memory ready to send to the second subsystem inthe subsequent step.
 9. The processing system of claim 7, wherein thememory comprises a first-in, first-out (FIFO) buffer and the reservedspace is space in the FIFO.
 10. The processing system of claim 5,wherein at least one of said one or more interactions is to transfer thedata as part of a stream; and wherein the one or more parameters foreach stream comprise at least a stream ID identifying a stream, anindication that the second subsystem is to begin streaming between thesecond subsystem and the memory of the first subsystem in the subsequentstep, and a direction of the stream.
 11. The processing system of claim4, wherein: at least one of the one or more interactions is to transferdata between the second subsystem and a memory of the first subsystem,and wherein the one or more preparatory operations comprise one or moreoperations to prepare the memory for the transfer; the at least oneparameter comprises a direction of the transfer, the direction beingeither: incoming from the second subsystem to the memory of the firstsubsystem, or outgoing from the memory of the first subsystem to thesecond subsystem; at least one of said one or more interactions is totransfer the data as part of a stream, wherein the one or moreparameters for each stream comprise at least a stream ID identifying astream, an indication that the second subsystem is to begin streamingbetween the second subsystem and the memory of the first subsystem inthe subsequent step, and a direction of the stream; and the stream ID ismapped to the behaviour ID in a first of said look-up tables, andwherein the portion size and direction are mapped to the stream ID in asecond of said look-up tables.
 12. The processing system of claim 1,wherein said subsequent step is the next step following the current stepin said series by default.
 13. The processing system of claim 1, whereinsaid subsequent step is operable to be any of a number of stepsfollowing the current step in said series, wherein said number isspecified by the descriptor.
 14. The processing system of claim 1,wherein the descriptor specifies at least one interaction for each ofthe next N steps following the current step in said series, where N isspecified by the descriptor; the first subsystem being configured toprepare for each of said N steps prior to the respective barrier leadinginto each.
 15. The processing system of claim 2, comprisingsynchronization logic configured to return the synchronizationacknowledgement signal to the second subsystem on condition of: i)receiving a synchronization request signal from the second subsystem,and ii) receiving permission from the first subsystem system to returnthe synchronization acknowledgement.
 16. The processing system of claim15, wherein the synchronization logic comprises a register for storing anumber of credits, the register being writeable by the first subsystem;wherein said permission is granted when the register is written with atleast one credit but denied when the credits are exhausted; and whereinthe synchronization logic is configured to automatically decrement thenumber of credits in the register each time an instance of thesynchronization acknowledgement signal is returned to the secondsubsystem.
 17. The processing system of claim 1, wherein the the firstsubsystem comprises a host subsystem, the one or more first processorscomprising at least one host CPU and optionally one or more gatewayprocessors arranged as a gateway between the host CPU and the secondsubsystem; and the second subsystem comprises an accelerator subsystem,the one or more second processors comprising one or more acceleratorprocessors arranged to perform work allocated by the host CPU.
 18. Theprocessing system of claim 1, wherein the code on the second subsystemand the portion of code on the first subsystem are staticallypre-compiled to operate together to perform said interaction.
 19. Amethod of operating a system comprising a first subsystem having a firstprocessor, and a second subsystem having a second processor, the methodcomprising: arranging the second subsystem to process code over a seriesof steps; in a first one of the steps, sending a descriptor from thesecond subsystem to the first subsystem specifying a value of aparameter of an interaction that the second subsystem is programmed toperform with the first subsystem via an inter-processor interconnect ina subsequent one of the steps; and on the first subsystem, performing apreparatory operation based on the specified value of the parameter ofthe interaction as specified by the descriptor, to prepare for theinteraction prior to the subsequent step.
 20. The method of claim 19,wherein the steps of the series are each separated by a barriersynchronization.
 21. The method of claim 19, wherein the preparatoryoperation is performed before a barrier synchronization separating thefirst step and the subsequent step.
 22. The method of claim 19, furthercomprising: storing a look-up table mapping each of a set of behaviourIDs to a different respective one of a plurality of differentinteraction definitions, each definition comprising a respective valuefor the parameter, and wherein the descriptor indicates a first one ofthe behaviour IDs; and determining, by the first subsystem, thespecified value by looking up a first definition mapped to the firstbehaviour ID in the look-up table; wherein the preparatory operation isperformed based on the first definition.
 23. The method of claim 19,wherein the interaction includes transferring data between the secondsubsystem and a memory of the first subsystem, and wherein thepreparatory operation includes preparing the memory for the transfer.24. The method of claim 19, wherein the at least one parameter comprisesa direction of data transfer between the second subsystem and a memoryof the first subsystem, the direction being either: incoming from thesecond subsystem to the memory of the first subsystem or outgoing fromthe memory of the first subsystem to the second subsystem.
 25. Themethod of claim 19, wherein the interaction comprises transferring anincoming portion of data from the second subsystem to a memory of thefirst subsystem, wherein the parameter comprises at least a size of theincoming portion of data, and wherein the preparatory operation includesreserving a corresponding amount of space in the memory.
 26. The methodof claim 19, wherein the interaction comprises transferring an outgoingportion of data to the second subsystem from a memory of the firstsubsystem, wherein the parameter comprises a size of the outgoingportion of data, and wherein the preparatory operation comprises one,more or all of: reserving a corresponding amount space in the memory tostore the outgoing portion of data, generating the outgoing portion ofdata, and storing the outgoing portion of data in the memory ready tosend to the second subsystem in the subsequent step.
 27. The method ofclaim 19, the interaction comprises transferring data as part of astream; and wherein the parameter comprises an item selected from thelist consisting of: a stream ID, an indication that the second subsystemis to begin streaming between the second subsystem and the memory of thefirst subsystem in the subsequent step, and a direction of the stream.28. A non-transitory computer-readable storage medium having storedthereon computer-executable code configured so as when run on a systemcomprising a first subsystem having a first processor and a secondsubsystem having a second processor, performs operations of: controllingthe second subsystem to run the program over a series of steps; in afirst one of the steps, controlling the second subsystem to send adescriptor to the first subsystem specifying a value of a parameter ofan interaction that the second subsystem is programmed to perform withthe first subsystem via an inter-processor interconnect in a subsequentone of the steps; and controlling the first subsystem to perform apreparatory operation, based on the specified value of the parameter ofthe interaction as specified by the descriptor, to prepare for said theinteraction prior to said subsequent step.
 29. The non-transitorycomputer-readable storage medium of claim 28, wherein the steps of theseries are each separated by a barrier synchronization.
 30. Thenon-transitory computer-readable storage medium of claim 28, theoperations further comprising: storing a look-up table mapping each of aset of behaviour IDs to a different respective one of a plurality ofdifferent interaction definitions, each definition comprising arespective value for the parameter, and wherein the descriptor indicatesa first one of the behaviour IDs; and determining, by the firstsubsystem, the specified value by looking up a first definition mappedto the first behaviour ID in the look-up table; wherein the preparatoryoperation is performed based on the first definition.